#include <color.h>
Public Methods | |
| void | SetIdentity () |
| Clear all color transformations. | |
| void | SetAlpha (U8 a) |
| Set the alpha. 0 is transparent and 255 is opaque. | |
| void | TintRed (U8 tint) |
| Tint but leave the other channels unchanged. | |
| void | TintGreen (U8 tint) |
| Tint but leave the other channels unchanged. | |
| void | TintBlue (U8 tint) |
| Tint but leave the other channels unchanged. | |
| void | TintAlpha (U8 tint) |
| Only sets alpha, but in inverse: 0 is opaque. | |
| void | Brighten (U8 val) |
| Approximate brightening -- not symmetric with darken. val==0 is no change. | |
| void | Darken (U8 val) |
| Approximate darkening -- not symmetric with brighten. val==0 is no change. | |
| void | Set (U8 mRed, U8 bRed, U8 mGreen, U8 bGreen, U8 mBlue, U8 bBlue, U8 alpha) |
| Arbitrary set of the components. More... | |
| void | SetRed (U8 _m, U8 _b) |
| Arbitrary red set (other channel will not be affected.). | |
| void | SetGreen (U8 _m, U8 _b) |
| Arbitrary green set (other channel will not be affected.). | |
| void | SetBlue (U8 _m, U8 _b) |
| Arbitrary blue set (other channel will not be affected.). | |
Unlike vectors and rectangles, it has many invalid states and is better ecapselated. It does have a constructor, and it's private data can not be directly accessed.
c' = m * c / 255 + b / 255
where:
Using the "Friendly API" this will never be a problem: values will be kept in range for you. When using Set* directly, however, be cautious.
|
||||||||||||||||||||||||||||||||
|
Arbitrary set of the components. Gives lots of control over the color transformation. The color is transformed by the equation: c' = m * c / 255 + b / 255 where:
The "friendly api", above, will always guarentee color transformations are correctly bounded. |
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001