]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.common/src/org/simantics/common/utils/CommonUtils.java b/bundles/org.simantics.common/src/org/simantics/common/utils/CommonUtils.java
new file mode 100644 (file)
index 0000000..53b0d7a
--- /dev/null
@@ -0,0 +1,15 @@
+package org.simantics.common.utils;\r
+\r
+public class CommonUtils {\r
+\r
+       public static double convertColor256ToDouble(int value) {\r
+        // TODO: how close to 256 can we go? \r
+               return (1/255.9999)*((double)value);\r
+       }\r
+       \r
+       public static int convertDoubleToColor256(double value) {\r
+               // TODO: how close to 256 can we go? \r
+               return (int)(255.9999*value);\r
+       }\r
+       \r
+}\r