WebContent+WebWorker: Don't set the color value to the index of an enum

The NamedColor would be casted to its underlying int to fit the ARGB on
the left hand side.
This commit is contained in:
Lucas CHOLLET 2024-05-23 23:07:39 -04:00 committed by Andreas Kling
commit 5b2356b452
Notes: sideshowbarker 2024-07-17 07:48:42 +09:00
2 changed files with 4 additions and 4 deletions

View file

@ -145,8 +145,8 @@ void PageClient::setup_palette()
VERIFY(!buffer_or_error.is_error());
auto buffer = buffer_or_error.release_value();
auto* theme = buffer.data<Gfx::SystemTheme>();
theme->color[(int)Gfx::ColorRole::Window] = Color::Magenta;
theme->color[(int)Gfx::ColorRole::WindowText] = Color::Cyan;
theme->color[to_underlying(Gfx::ColorRole::Window)] = Color(Color::Magenta).value();
theme->color[to_underlying(Gfx::ColorRole::WindowText)] = Color(Color::Cyan).value();
m_palette_impl = Gfx::PaletteImpl::create_with_anonymous_buffer(buffer);
}