From fccf1e2eac691443108de8f666d611327dbfcfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Wed, 27 Apr 2022 23:00:02 +0200 Subject: [PATCH] Support CSS Color Module Level 4 (#12204) --- doc/lua_api.txt | 2 +- src/util/string.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index f53ab0ff7..f54672db7 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -3248,7 +3248,7 @@ Colors `#RRGGBBAA` defines a color in hexadecimal format and alpha channel. Named colors are also supported and are equivalent to -[CSS Color Module Level 3](https://www.w3.org/TR/css-color-3/). +[CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#named-color). To specify the value of the alpha channel, append `#A` or `#AA` to the end of the color name (e.g. `colorname#08`). diff --git a/src/util/string.cpp b/src/util/string.cpp index 39cd44667..b805b2f78 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -494,6 +494,7 @@ const static std::unordered_map s_named_colors = { {"plum", 0xdda0dd}, {"powderblue", 0xb0e0e6}, {"purple", 0x800080}, + {"rebeccapurple", 0x663399}, {"red", 0xff0000}, {"rosybrown", 0xbc8f8f}, {"royalblue", 0x4169e1},