Difference between revisions of "Legacy:Functions/ColorMatrices"
From Spherical
(created) |
(No difference)
|
Latest revision as of 17:35, 22 May 2013
Color matrices
- Sphere ColorMatrix object used to transform colors
- CreateColorMatrix(rn, rr, rg, rb, gn, gr, gg, gb, bn, br, bg, bb): Creates a ColorMatrix that is used to transform the colors contained in a pixel with the following formula:
- newcolor.red = rn + (rr * oldcolor.red + rg * oldcolor.green + rb * oldcolor.blue) / 255;
- newcolor.green = gn + (gr * oldcolor.red + gg * oldcolor.green + gb * oldcolor.blue) / 255;
- newcolor.blue = bn + (br * oldcolor.red + bg * oldcolor.green + bb * oldcolor.blue) / 255;
(see Surface.applyColorFX and Surface.applyColorFX4)