Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Color.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | struct CColor | ||||
*/ | */ | ||||
operator bool() const | operator bool() const | ||||
{ | { | ||||
return r >= 0 && g >= 0 && b >= 0 && a >= 0; | return r >= 0 && g >= 0 && b >= 0 && a >= 0; | ||||
} | } | ||||
/** | /** | ||||
* Try to parse @p Value as a color. Returns true on success, false otherwise. | * Try to parse @p Value as a color. Returns true on success, false otherwise. | ||||
* Leaves the color unchanged if it failed. | |||||
* @param value Should be "r g b" or "r g b a" where each value is an integer in [0,255]. | * @param value Should be "r g b" or "r g b a" where each value is an integer in [0,255]. | ||||
* @param defaultAlpha The alpha value that is used if the format of @p Value is "r g b". | * @param defaultAlpha The alpha value that is used if the format of @p Value is "r g b". | ||||
*/ | */ | ||||
bool ParseString(const CStr8& value, int defaultAlpha = 255); | bool ParseString(const CStr8& value, int defaultAlpha = 255); | ||||
bool operator==(const CColor& color) const; | bool operator==(const CColor& color) const; | ||||
bool operator!=(const CColor& color) const | bool operator!=(const CColor& color) const | ||||
{ | { | ||||
Show All 21 Lines |
Wildfire Games · Phabricator