#include <ColorType.h>
Public Member Functions | |
| ColorType (unsigned int r, unsigned int g, unsigned int b, unsigned int a=255) | |
| ColorType () | |
| ~ColorType () | |
| BROKEN_INLINE_HINT ColorType & | operator= (const ColorType &color) |
| bool | operator!= (const ColorType &color) const |
| bool | operator== (const ColorType &color) const |
| bool | isValid () const |
Static Public Member Functions | |
| static ColorType | getUniqueColor (const std::vector< ColorType > &excludedColors) |
| static unsigned int | getUniqueColors (unsigned int count, std::vector< ColorType > &colors, const std::vector< ColorType > &excludeColors) |
Public Attributes | |
| int | mRed |
| int | mGreen |
| int | mBlue |
| int | mAlpha |
Related Functions | |
| (Note that these are not member functions.) | |
| COLORTYPE_TO_QCOLOR(colorType) | |
| QCOLOR_TO_COLORTYPE(qcolor) | |
Definition at line 50 of file ColorType.h.
| ColorType::ColorType | ( | unsigned int | r, | |
| unsigned int | g, | |||
| unsigned int | b, | |||
| unsigned int | a = 255 | |||
| ) |
Creates a ColorType object with given RGB values.
Valid RGB values range from 0 to 255.
| r | The red value. | |
| g | The green value. | |
| b | The blue value. | |
| a | The alpha (opacity) value. |
Definition at line 67 of file ColorType.h.
| ColorType::ColorType | ( | ) |
| ColorType::~ColorType | ( | ) |
| static ColorType ColorType::getUniqueColor | ( | const std::vector< ColorType > & | excludedColors | ) | [static] |
Returns a unique color that is farthest away in color space from given colors.
| excludedColors | The colors from which the unique color is calculated. |
Definition at line 89 of file ColorType.h.
| static unsigned int ColorType::getUniqueColors | ( | unsigned int | count, | |
| std::vector< ColorType > & | colors, | |||
| const std::vector< ColorType > & | excludeColors | |||
| ) | [static] |
Generates one or more colors that are unique to each other.
| count | The requested number of colors to generate. | |
| colors | A vector that is populated with the generated colors. | |
| excludeColors | Colors that should not be included in the generated colors. |
Definition at line 199 of file ColorType.h.
Definition at line 288 of file ColorType.h.
| bool ColorType::operator!= | ( | const ColorType & | color | ) | const |
Definition at line 301 of file ColorType.h.
| bool ColorType::operator== | ( | const ColorType & | color | ) | const |
Definition at line 311 of file ColorType.h.
| bool ColorType::isValid | ( | ) | const |
Queries the color for its validity.
A valid color has RGB values ranging from 0 to 255.
Definition at line 328 of file ColorType.h.
| COLORTYPE_TO_QCOLOR | ( | colorType | ) | [related] |
Converts a ColorType to a QColor.
| colorType | The ColorType to convert to a QColor. If an invalid ColorType is passed in, an invalid QColor will be created. |
Definition at line 30 of file ColorType.h.
| QCOLOR_TO_COLORTYPE | ( | qcolor | ) | [related] |
Converts a QColor to a ColorType.
| qcolor | The QColor to convert to a ColorType. If an invalid QColor is passed in, an invalid ColorType will be created. |
Definition at line 44 of file ColorType.h.
| int ColorType::mRed |
Definition at line 341 of file ColorType.h.
Definition at line 342 of file ColorType.h.
| int ColorType::mBlue |
Definition at line 343 of file ColorType.h.
Definition at line 344 of file ColorType.h.