]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.datatypes/src/org/simantics/datatypes/conversion/RGBIntegerColorAdapter.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.datatypes / src / org / simantics / datatypes / conversion / RGBIntegerColorAdapter.java
1 package org.simantics.datatypes.conversion;
2
3 import org.simantics.datatypes.adt.Color;
4 import org.simantics.datatypes.literal.RGB;
5
6 public class RGBIntegerColorAdapter implements Color {
7         
8     public RGB.Integer rgb;
9     
10         @Override
11         public double getR() {
12                 return (1.0/512.0) + (1.0/256.0) * (double)rgb.red;
13         }
14         
15         @Override
16         public double getG() {
17                 return (1.0/512.0) + (1.0/256.0) * (double)rgb.green;
18         }
19         
20         @Override
21         public double getB() {
22                 return (1.0/512.0) + (1.0/256.0) * (double)rgb.blue;
23         }
24         
25         @Override
26         public double getA() {
27                 return 0;
28         }
29         
30         @Override
31         public double getH() {
32                 return 0;
33         }
34         
35         @Override
36         public double getS() {
37                 return 0;
38         }
39         
40         @Override
41         public double getV() {
42                 return 0;
43         }
44         
45 }