diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-07-08 20:03:06 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-07-08 21:17:10 +0200 |
commit | 28d3a6051ce197579817fb56521f539f2951d7e1 (patch) | |
tree | dad336849527e088eeace537e8befcc4fe82b14e /scene/gui/rich_text_label.cpp | |
parent | 56269e2db835e50a4cf2681bb73c44ae41fcca10 (diff) |
Use base `Color()` constructors instead of `Color::html()`
This results in slightly smaller binaries (-17 KB for an editor binary)
as no strings need to be allocated.
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 5b91299de6..d6c0981ebc 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1942,37 +1942,37 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) { if (col.begins_with("#")) color = Color::html(col); else if (col == "aqua") - color = Color::html("#00FFFF"); + color = Color(0, 1, 1); else if (col == "black") - color = Color::html("#000000"); + color = Color(0, 0, 0); else if (col == "blue") - color = Color::html("#0000FF"); + color = Color(0, 0, 1); else if (col == "fuchsia") - color = Color::html("#FF00FF"); + color = Color(1, 0, 1); else if (col == "gray" || col == "grey") - color = Color::html("#808080"); + color = Color(0.5, 0.5, 0.5); else if (col == "green") - color = Color::html("#008000"); + color = Color(0, 0.5, 0); else if (col == "lime") - color = Color::html("#00FF00"); + color = Color(0, 1, 0); else if (col == "maroon") - color = Color::html("#800000"); + color = Color(0.5, 0, 0); else if (col == "navy") - color = Color::html("#000080"); + color = Color(0, 0, 0.5); else if (col == "olive") - color = Color::html("#808000"); + color = Color(0.5, 0.5, 0); else if (col == "purple") - color = Color::html("#800080"); + color = Color(0.5, 0, 0.5); else if (col == "red") - color = Color::html("#FF0000"); + color = Color(1, 0, 0); else if (col == "silver") - color = Color::html("#C0C0C0"); + color = Color(0.75, 0.75, 0.75); else if (col == "teal") - color = Color::html("#008008"); + color = Color(0, 0.5, 0.5); else if (col == "white") - color = Color::html("#FFFFFF"); + color = Color(1, 1, 1); else if (col == "yellow") - color = Color::html("#FFFF00"); + color = Color(1, 1, 0); else color = base_color; |