diff options
| author | Martin Haug <mhaug@live.de> | 2022-02-08 21:12:09 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-02-08 21:12:09 +0100 |
| commit | fe70db1f4ce078f7b41c163a1c0ead31fd04850a (patch) | |
| tree | 0f85390a89a05dc763cbc2eb6c611c48877c08cd /tests/typ/utility | |
| parent | 62cf2a19d7207118f115c05c8f7c453d6db77a0a (diff) | |
New color stuff
- CMYK function
- More default colors
- Interpret RGB values as sRGB
Diffstat (limited to 'tests/typ/utility')
| -rw-r--r-- | tests/typ/utility/color.typ | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/typ/utility/color.typ b/tests/typ/utility/color.typ index 759672ff..fa30a4f2 100644 --- a/tests/typ/utility/color.typ +++ b/tests/typ/utility/color.typ @@ -3,20 +3,21 @@ --- // Compare both ways. -#test(rgb(0.0, 0.3, 0.7), rgb("004db3")) +#test(rgb(0%, 30%, 70%), rgb("004db3")) // Alpha channel. -#test(rgb(1.0, 0.0, 0.0, 0.5), rgb("ff000080")) +#test(rgb(255, 0, 0, 50%), rgb("ff000080")) --- -// Error for values that are out of range. -// Error: 11-14 value must be between 0.0 and 1.0 -#test(rgb(-30, 15.5, 0.5)) +// Test CMYK color conversion. +// Ref: true +#rect(fill: cmyk(69%, 11%, 69%, 41%)) +#rect(fill: cmyk(50%, 64%, 16%, 17%)) --- // Error for values that are out of range. -// Error: 26-30 value must be between 0.0 and 1.0 -#test(rgb(0.1, 0.2, 0.3, -0.1)) +// Error: 11-14 must be between 0 and 255 +#test(rgb(-30, 15, 50)) --- // Error: 6-11 invalid hex string @@ -31,5 +32,5 @@ #rgb(0, 1) --- -// Error: 21-26 expected float, found boolean -#rgb(0.1, 0.2, 0.3, false) +// Error: 21-26 expected integer or relative, found boolean +#rgb(10%, 20%, 30%, false) |
