1 package org.simantics.modeling.ui.diagram.monitor;
\r
3 import org.simantics.common.color.Color;
\r
4 import org.simantics.databoard.Bindings;
\r
5 import org.simantics.db.ReadGraph;
\r
6 import org.simantics.db.Resource;
\r
7 import org.simantics.db.exception.DatabaseException;
\r
9 public class RGB implements Color {
\r
13 public RGB(double r, double g, double b) {
\r
14 this.r = r; this.g = g; this.b=b;
\r
17 public RGB(ReadGraph graph, Resource resource) throws DatabaseException {
\r
18 double[] array = graph.getValue(resource, Bindings.DOUBLE_ARRAY);
\r
19 assert(array.length == 3);
\r
26 public double getR() {
\r
31 public double getG() {
\r
36 public double getB() {
\r
41 public double getA() {
\r
42 throw new UnsupportedOperationException();
\r
46 public double getH() {
\r
47 throw new UnsupportedOperationException();
\r
51 public double getS() {
\r
52 throw new UnsupportedOperationException();
\r
56 public double getV() {
\r
57 throw new UnsupportedOperationException();
\r