Last active
December 17, 2015 20:49
-
-
Save davidsonfellipe/5670524 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function colorCIEXYZtosRGB(XYZ) { | |
var RGBTEMP = {R:0, | |
G:0, | |
B:0}; | |
RGBTEMP.R = 3.2404542 * XYZ.X - 1.5371385 * XYZ.Y - 0.4985314 * XYZ.Z; | |
RGBTEMP.G =-0.9692660 * XYZ.X + 1.8760108 * XYZ.Y + 0.0415560 * XYZ.Z; | |
RGBTEMP.B = 0.0556434 * XYZ.X - 0.2040259 * XYZ.Y + 1.0572252 * XYZ.Z; | |
//converter for 0-255 notation | |
var cmultiply = 255; | |
RGBTEMP.R = gamma_sRGB(RGBTEMP.R) * cmultiply; | |
RGBTEMP.G = gamma_sRGB(RGBTEMP.G) * cmultiply; | |
RGBTEMP.B = gamma_sRGB(RGBTEMP.B) * cmultiply; | |
return RGBTEMP; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment