Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Bug 1996318 - Add display-p3-linear color-space to css color(). r=#st…
…yle,tlouw

It's display-p3 without gamma encoding. cssparser change will obviously
go upstream.

Differential Revision: https://phabricator.services.mozilla.com/D270012
  • Loading branch information
emilio committed Oct 24, 2025
commit 923da6c3bbbace0562f1cd168c21e7a960edfa19
4 changes: 4 additions & 0 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ pub enum PredefinedColorSpace {
SrgbLinear,
/// <https://drafts.csswg.org/css-color-4/#predefined-display-p3>
DisplayP3,
/// <https://drafts.csswg.org/css-color-4/#predefined-display-p3-linear>
DisplayP3Linear,
/// <https://drafts.csswg.org/css-color-4/#predefined-a98-rgb>
A98Rgb,
/// <https://drafts.csswg.org/css-color-4/#predefined-prophoto-rgb>
Expand All @@ -107,6 +109,7 @@ impl PredefinedColorSpace {
"srgb" => Self::Srgb,
"srgb-linear" => Self::SrgbLinear,
"display-p3" => Self::DisplayP3,
"display-p3-linear" => Self::DisplayP3Linear,
"a98-rgb" => Self::A98Rgb,
"prophoto-rgb" => Self::ProphotoRgb,
"rec2020" => Self::Rec2020,
Expand All @@ -126,6 +129,7 @@ impl ToCss for PredefinedColorSpace {
Self::Srgb => "srgb",
Self::SrgbLinear => "srgb-linear",
Self::DisplayP3 => "display-p3",
Self::DisplayP3Linear => "display-p3-linear",
Self::A98Rgb => "a98-rgb",
Self::ProphotoRgb => "prophoto-rgb",
Self::Rec2020 => "rec2020",
Expand Down
Loading