diff options
| author | frozolotl <44589151+frozolotl@users.noreply.github.com> | 2023-11-21 18:05:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-21 18:05:12 +0100 |
| commit | 55799f73952f66b937a75f5e7f99604987238399 (patch) | |
| tree | e079cc8e45e9dcfe599c17307068ce94133e5c1d | |
| parent | 36c73016086436eb4cda1c61ab8200cafc38a719 (diff) | |
Make `color.components`' alpha parameter named (#2734)
| -rw-r--r-- | crates/typst/src/geom/color.rs | 1 | ||||
| -rw-r--r-- | tests/typ/compiler/methods.typ | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/crates/typst/src/geom/color.rs b/crates/typst/src/geom/color.rs index 247b424b..3f5ef479 100644 --- a/crates/typst/src/geom/color.rs +++ b/crates/typst/src/geom/color.rs @@ -702,6 +702,7 @@ impl Color { pub fn components( self, /// Whether to include the alpha component. + #[named] #[default(true)] alpha: bool, ) -> Array { diff --git a/tests/typ/compiler/methods.typ b/tests/typ/compiler/methods.typ index 4c483786..bd38bbd4 100644 --- a/tests/typ/compiler/methods.typ +++ b/tests/typ/compiler/methods.typ @@ -122,7 +122,7 @@ #test(luma(40).to-hex(), "#282828") #test-repr(cmyk(4%, 5%, 6%, 7%).to-hex(), "#e4e1df") #test-repr(rgb(cmyk(4%, 5%, 6%, 7%)).components(), (89.28%, 88.35%, 87.42%, 100%)) -#test-repr(rgb(luma(40%)).components(false), (40%, 40%, 40%)) +#test-repr(rgb(luma(40%)).components(alpha: false), (40%, 40%, 40%)) #test-repr(cmyk(luma(40)).components(), (11.76%, 10.67%, 10.51%, 14.12%)) #test-repr(cmyk(rgb(1, 2, 3)), cmyk(66.67%, 33.33%, 0%, 98.82%)) #test-repr(luma(rgb(1, 2, 3)), luma(0.73%)) |
