lr
, lg
, and lb
are the luminance constants. If you compute the dot product of <R
, G
, B
> with <lr
, lg
, lb
> you'll get the luminance of the color. This is useful if you want to change the hue and/or saturation without changing the luminance of the color.
I don't recognize a
, b
, and c
off the top of my head. They're probably chrominance (saturation)-related.
The hueangle
is the angle you want to rotate your color. It rotates around the R
=G
=B
axis. If you rotate 180° red becomes cyan, green becomes magenta, yellow becomes blue, etc.
You might find the Gamma FAQ useful, as it describes a lot of these concepts. And this page describes the math behind rotating around an arbitrary axis.
Also, you generally want a 4x4 matrix for color conversion, not 5x5.