WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

Color

Provides generic support for colour conversions.
The library is currently aware of both the RGB and YUV colour spaces and this module allows you to convert between the two. Note that not all of the colours in one colour space are exactly reproducible in another and hence converting from one colour space and back again will not necessarily give the same result.
A colour variable can be created using:-
Color myColor;
Although this variable will start with an 'unknown' value.
However: you can assign it a known value using the 'setRGB' and 'setYUV' commands.
You can copy one colour to another with the '=' operator just as if they were numbers ie:
Color myColor1, myColor2;
myColor1.setRGB(20,32,45);
myColor2 = myColor1;
You can also test if two colours are identical with the '==' and '!=' operators just as if they were numbers ie:
if( myColor1 == myColor2){
    cout << "Same";
}
You can convert to a particular colour space using the makeRGB and makeYUV functions. The return value of these functions then allow you to access the individual colour components.

 

Method

 

Valid XHTML 1.0 Transitional