Make color.components
' alpha parameter named (#2734)
This commit is contained in:
parent
36c7301608
commit
55799f7395
@ -702,6 +702,7 @@ impl Color {
|
||||
pub fn components(
|
||||
self,
|
||||
/// Whether to include the alpha component.
|
||||
#[named]
|
||||
#[default(true)]
|
||||
alpha: bool,
|
||||
) -> Array {
|
||||
|
@ -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%))
|
||||
|
Loading…
x
Reference in New Issue
Block a user