From e7f7823236e6bac0c7b016d207572d73d7f0e562 Mon Sep 17 00:00:00 2001 From: Zae Date: Sat, 29 Mar 2025 06:06:09 +0800 Subject: [PATCH] Fix reversed hex order in `Color::to_html` --- core/math/color.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/math/color.cpp b/core/math/color.cpp index d75a33f6a15..699d414cc95 100644 --- a/core/math/color.cpp +++ b/core/math/color.cpp @@ -113,10 +113,8 @@ void _append_hex(float p_val, char32_t *string) { int v = Math::round(p_val * 255.0f); v = CLAMP(v, 0, 255); - for (int i = 0; i < 2; i++) { - string[i] = hex_char_table_lower[v & 0xF]; - v >>= 4; - } + string[0] = hex_char_table_lower[(v >> 4) & 0xF]; + string[1] = hex_char_table_lower[v & 0xF]; } String Color::to_html(bool p_alpha) const {