]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.common/src/org/simantics/common/utils/CommonUtils.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.common / src / org / simantics / common / utils / CommonUtils.java
1 package org.simantics.common.utils;\r
2 \r
3 public class CommonUtils {\r
4 \r
5         public static double convertColor256ToDouble(int value) {\r
6         // TODO: how close to 256 can we go? \r
7                 return (1/255.9999)*((double)value);\r
8         }\r
9         \r
10         public static int convertDoubleToColor256(double value) {\r
11                 // TODO: how close to 256 can we go? \r
12                 return (int)(255.9999*value);\r
13         }\r
14         \r
15 }\r