Skip to content

Instantly share code, notes, and snippets.

@andrewschaaf
Created February 26, 2011 22:44
Show Gist options
  • Save andrewschaaf/845701 to your computer and use it in GitHub Desktop.
Save andrewschaaf/845701 to your computer and use it in GitHub Desktop.
XYZ_to_CAT02 = (XYZ) ->
[X, Y, Z] = XYZ
return [
.7328 * X + .4296 * Y - .1624 * Z, # R
- .7036 * X + 1.6975 * Y + .0061 * Z, # G
.0030 * X + .0136 * Y + .9834 * Z] # B
XYZ_to_CAT02 = ([X, Y, Z]) ->
[
.7328 * X + .4296 * Y - .1624 * Z # R
- .7036 * X + 1.6975 * Y + .0061 * Z # G
.0030 * X + .0136 * Y + .9834 * Z] # B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment