| 132 | #[cfg(feature = "chromashift")] |
| 133 | impl 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> |