1 package org.simantics.common.utils;
3 public class CommonUtils {
5 public static double convertColor256ToDouble(int value) {
6 // TODO: how close to 256 can we go?
7 return (1/255.9999)*((double)value);
10 public static int convertDoubleToColor256(double value) {
11 // TODO: how close to 256 can we go?
12 return (int)(255.9999*value);