LibWeb+LibGfx: Serialize HTML canvas fill/strokeStyle colors correctly

Before this change we were serializing them in a bogus 8-digit hex color
format that isn't actually recognized by HTML.

This code will need more work when we start supporting color spaces
other than sRGB.
This commit is contained in:
Andreas Kling 2024-10-04 14:10:07 +02:00 committed by Andreas Kling
commit 4590c081c2
Notes: github-actions[bot] 2024-10-04 18:02:27 +00:00
7 changed files with 58 additions and 9 deletions

View file

@ -63,7 +63,7 @@ public:
{
return m_fill_or_stroke_style.visit(
[&](Gfx::Color color) -> JsFillOrStrokeStyle {
return color.to_string();
return color.to_string(Gfx::Color::HTMLCompatibleSerialization::Yes);
},
[&](auto handle) -> JsFillOrStrokeStyle {
return handle;