MCPcopy Create free account
hub / github.com/csskit/csskit / to_chromashift

Method to_chromashift

crates/css_ast/src/functions/color_function.rs:134–150  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

132#[cfg(feature = "chromashift")]
133impl crate::ToChromashift for ColorFunction<'_> {
134 fn to_chromashift(&self) -> Option<chromashift::Color> {
135 match self {
136 Self::Relative(r) => r.to_chromashift(),
137 Self::Color(c) => c.to_chromashift(),
138 Self::ColorMix(c) => c.to_chromashift(),
139 Self::LightDark(_c) => None,
140 Self::Rgb(c) => c.to_chromashift(),
141 Self::Rgba(c) => c.to_chromashift(),
142 Self::Hsl(c) => c.to_chromashift(),
143 Self::Hsla(c) => c.to_chromashift(),
144 Self::Hwb(c) => c.to_chromashift(),
145 Self::Lab(c) => c.to_chromashift(),
146 Self::Lch(c) => c.to_chromashift(),
147 Self::Oklab(c) => c.to_chromashift(),
148 Self::Oklch(c) => c.to_chromashift(),
149 }
150 }
151}
152
153/// <https://drafts.csswg.org/css-color/#funcdef-color>

Callers

nothing calls this directly

Calls 15

SrgbClass · 0.85
LinearRgbClass · 0.85
DisplayP3Class · 0.85
A98RgbClass · 0.85
ProphotoRgbClass · 0.85
Rec2020Class · 0.85
XyzD65Class · 0.85
XyzD50Class · 0.85
HslClass · 0.85
HwbClass · 0.85
LabClass · 0.85
LchClass · 0.85

Tested by

no test coverage detected