pub fn resolve(&self, system_colors: &crate::system::SystemColors, fallback: ColorU) -> ColorU {
SystemColorRef::WindowBackground => colors.window_background.as_option().copied().unwrap_or(fallback),
SystemColorRef::SelectionBackground => colors.selection_background.as_option().copied().unwrap_or(fallback),
SystemColorRef::SelectionText => colors.selection_text.as_option().copied().unwrap_or(fallback),
InvalidFunctionName(i) => format!("Invalid function name, expected one of: \"rgb\", \"rgba\", \"hsl\", \"hsla\" got: \"{}\"", i),
InvalidColorComponent(i) => format!("Invalid color component when parsing CSS color: \"{}\"", i),
IntValueParseErr(e) => format!("CSS color component: Value not in range between 00 - FF: \"{}\"", e),
FloatValueParseErr(e) => format!("CSS color component: Value cannot be parsed as floating point number: \"{}\"", e),
FloatValueOutOfRange(v) => format!("CSS color component: Value not in range between 0.0 - 1.0: \"{}\"", v),
DirectionParseError(e) => format!("Could not parse direction argument for CSS color: \"{}\"", e),
pub fn parse_color_or_system<'a>(input: &'a str) -> Result<ColorOrSystem, CssColorParseError<'a>> {