Pixel - Serabe/rinzelight GitHub Wiki
In rinzelight.pixel there are a few functions for working with pixel. There is a pixel structure (pixel-packet) too. Most of time, it is easier to work directly with four-elements vectors.
pixel-packet contains four fields, one for each channel. For creating them, it is adviced to use the function create-pixel that accepts either one, three or four arguments.
Given a value, if it is negative, it returns zero; if it is greter than (quantum-range), it returns (quantum-range). It returns the value itself otherwise.
Whenever you use a value for a channel, use round-to-quantum for avoiding problems.
Given a value, returns the difference between (quantum-range) and that value.
Same as before but for every channel but alpha.
It is a macro that returns the intensity of a pixel. Intensity is defined by the following formula:
0.299 * red + 0.587 * green + 0.114 * blue