1 package org.simantics.datatypes.literal;
\r
3 import org.simantics.common.color.Color;
\r
4 import org.simantics.common.utils.CommonUtils;
\r
5 import org.simantics.databoard.Bindings;
\r
6 import org.simantics.databoard.binding.Binding;
\r
7 import org.simantics.databoard.util.Bean;
\r
12 public static class Integer extends Bean implements Color {
\r
14 private static final long serialVersionUID = -8574259779076550543L;
\r
16 public static final Binding BINDING = Bindings.getBindingUnchecked(Integer.class);
\r
22 public Integer(int r, int g, int b) {
\r
24 this.red = r; this.green = g; this.blue = b;
\r
28 public String toString() {
\r
29 return "RGB.Integer[r=" + red + " ,g=" + green + " ,b=" + blue + "]";
\r
33 public double getR() {
\r
34 return CommonUtils.convertColor256ToDouble(red);
\r
38 public double getG() {
\r
39 return CommonUtils.convertColor256ToDouble(green);
\r
43 public double getB() {
\r
44 return CommonUtils.convertColor256ToDouble(blue);
\r
48 public double getA() {
\r
53 public double getH() {
\r
54 throw new UnsupportedOperationException();
\r
58 public double getS() {
\r
59 throw new UnsupportedOperationException();
\r
63 public double getV() {
\r
64 throw new UnsupportedOperationException();
\r