feat(core): support RGB alpha notation (#9699)

Functional notation: rgb[a](R G B[ / A])
CSS Colors Level 4 adds support for space-separated values in the functional notation.
See https://www.w3.org/TR/css-color-4/#rgb-functions

Co-authored-by: Nathan Walker <walkerrunpdx@gmail.com>
This commit is contained in:
Ruslan Lekhman
2022-01-13 22:38:57 -07:00
committed by Nathan Walker
parent 2cbb135250
commit 388d7eaa7d
6 changed files with 50 additions and 47 deletions

View File

@@ -59,6 +59,10 @@ export function test_setting_borderColorRGB_property_from_CSS_is_applied_to_Styl
test_property_from_CSS_is_applied_to_style('borderColor', 'border-color', new Color('#FF0000'), 'rgb(255, 0, 0)');
}
export function test_setting_borderColorRGBLvl4_property_from_CSS_is_applied_to_Style() {
test_property_from_CSS_is_applied_to_style('borderColor', 'border-color', new Color('#FF0000'), 'rgb(255 0 0 / 1)');
}
export function test_setting_borderColorRGBA_property_from_CSS_is_applied_to_Style() {
test_property_from_CSS_is_applied_to_style('borderColor', 'border-color', new Color('#FF0000'), 'rgba(255,0,0,1)');
}