26GUIColor GUIColor::GUICOLOR_WHITE(1.0f, 1.0f, 1.0f, 1.0f);
27GUIColor GUIColor::GUICOLOR_BLACK(0.0f, 0.0f, 0.0f, 1.0f);
28GUIColor GUIColor::GUICOLOR_RED(1.0f, 0.0f, 0.0f, 1.0f);
29GUIColor GUIColor::GUICOLOR_GREEN(0.0f, 1.0f, 0.0f, 1.0f);
30GUIColor GUIColor::GUICOLOR_BLUE(0.0f, 0.0f, 1.0f, 1.0f);
31GUIColor GUIColor::GUICOLOR_TRANSPARENT(0.0f, 0.0f, 0.0f, 0.0f);
32GUIColor GUIColor::GUICOLOR_EFFECT_COLOR_MUL(1.0f, 1.0f, 1.0f, 1.0f);
33GUIColor GUIColor::GUICOLOR_EFFECT_COLOR_ADD(0.0f, 0.0f, 0.0f, 0.0f);
35vector<GUIColor*> GUIColor::COLOR_INSTANCES = {{
44vector<string> GUIColor::COLOR_NAMES = {{
71 if (colorString.empty() ==
true) {
72 Console::println(
"GUI: Warning: No color given");
77 if (StringTools::equalsIgnoreCase(
COLOR_NAMES[i], colorString) ==
true) {
85 if (StringTools::startsWith(colorString,
"#") ==
false || (colorString.length() != 7 && colorString.length() != 9)) {
86 Console::println(
"GUI: Warning: Invalid color '" + (colorString) +
"'");
91 sscanf(colorString.substr(1, 3).c_str(),
"%02x", &colorValue);
92 data[0] = colorValue / 255.0f;
93 sscanf(colorString.substr(3, 5).c_str(),
"%02x", &colorValue);
94 data[1] = colorValue / 255.0f;
95 sscanf(colorString.substr(5, 7).c_str(),
"%02x", &colorValue);
96 data[2] = colorValue / 255.0f;
97 if (colorString.length() > 7) {
98 sscanf(colorString.substr(7, 9).c_str(),
"%02x", &colorValue);
99 data[3] = colorValue / 255.0f;
Color 4 base definition class.
array< float, 4 > & getArray() const
static STATIC_DLL_IMPEXT vector< GUIColor * > COLOR_INSTANCES
GUIColor()
Public constructor.
static STATIC_DLL_IMPEXT vector< string > COLOR_NAMES
static STATIC_DLL_IMPEXT GUIColor GUICOLOR_TRANSPARENT