Here you can find the source of rgb_xyz(double r)
public static double rgb_xyz(double r)
//package com.java2s; //License from project: Open Source License public class Main { public static double rgb_xyz(double r) { if ((r /= 255.0) <= 0.04045) { return r / 12.92; } else {/*from ww w . j a va 2 s . c o m*/ return Math.pow((r + 0.055) / 1.055, 2.4); } } }