Add some color and brush manipulation funcs (#2565)

The added functions enable mixing colors and manipulating the opacity
of colors and brushes.

They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
This commit is contained in:
Arthur Araruna 2023-04-16 10:50:16 -03:00 committed by Olivier Goffart
parent 0c64312383
commit 64ad1ce357
14 changed files with 553 additions and 8 deletions

View file

@ -2710,6 +2710,18 @@ fn compile_builtin_function_call(
BuiltinFunction::ColorDarker => {
format!("{}.darker({})", a.next().unwrap(), a.next().unwrap())
}
BuiltinFunction::ColorTranslucent => {
format!("{}.translucent({})", a.next().unwrap(), a.next().unwrap())
}
BuiltinFunction::ColorOpaque => {
format!("{}.opaque({})", a.next().unwrap(), a.next().unwrap())
}
BuiltinFunction::ColorMixed => {
format!("{}.mixed({}, {})", a.next().unwrap(), a.next().unwrap(), a.next().unwrap())
}
BuiltinFunction::ColorWithAlpha => {
format!("{}.with_alpha({})", a.next().unwrap(), a.next().unwrap())
}
BuiltinFunction::ImageSize => {
format!("{}.size()", a.next().unwrap())
}