Java tutorial
//package com.java2s; public class Main { private static double convertColorPart(double colorPart) { colorPart /= 255.0; if (colorPart <= 0.03928) { return colorPart / 12.92; } else { return Math.pow(((colorPart + 0.055) / 1.055), 2.4); } } }