mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb+LibGfx: Move CSS sRGB color serialization function to LibGfx
This commit is contained in:
parent
633fc45e0f
commit
ebd802f6fc
Notes:
github-actions[bot]
2025-10-26 17:56:37 +00:00
Author: https://github.com/tcl3
Commit: ebd802f6fc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6593
Reviewed-by: https://github.com/gmta ✅
8 changed files with 74 additions and 73 deletions
|
|
@ -57,7 +57,7 @@ String FilterValueListStyleValue::to_string(SerializationMode mode) const
|
|||
[&](FilterOperation::DropShadow const& drop_shadow) {
|
||||
builder.append("drop-shadow("sv);
|
||||
if (drop_shadow.color.has_value()) {
|
||||
serialize_a_srgb_value(builder, *drop_shadow.color);
|
||||
drop_shadow.color->serialize_a_srgb_value(builder);
|
||||
builder.append(' ');
|
||||
}
|
||||
builder.appendff("{} {}", drop_shadow.offset_x, drop_shadow.offset_y);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ bool HSLColorStyleValue::equals(StyleValue const& other) const
|
|||
String HSLColorStyleValue::to_string(SerializationMode mode) const
|
||||
{
|
||||
if (auto color = to_color({}); color.has_value())
|
||||
return serialize_a_srgb_value(color.value());
|
||||
return color->serialize_a_srgb_value();
|
||||
|
||||
StringBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ bool HWBColorStyleValue::equals(StyleValue const& other) const
|
|||
String HWBColorStyleValue::to_string(SerializationMode mode) const
|
||||
{
|
||||
if (auto color = to_color({}); color.has_value())
|
||||
return serialize_a_srgb_value(color.value());
|
||||
return color->serialize_a_srgb_value();
|
||||
|
||||
StringBuilder builder;
|
||||
builder.append("hwb("sv);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ String RGBColorStyleValue::to_string(SerializationMode mode) const
|
|||
return m_properties.name.value().to_string().to_ascii_lowercase();
|
||||
|
||||
if (auto color = to_color({}); color.has_value())
|
||||
return serialize_a_srgb_value(color.value());
|
||||
return color->serialize_a_srgb_value();
|
||||
|
||||
StringBuilder builder;
|
||||
builder.append("rgb("sv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue