mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix color mixing and gradients in luma space (#4424)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
parent
0fbec82035
commit
381a82e764
@ -1191,7 +1191,7 @@ impl Color {
|
||||
Color::Hsv(Hsv::new(RgbHue::from_degrees(m[0]), m[1], m[2], m[3]))
|
||||
}
|
||||
ColorSpace::Cmyk => Color::Cmyk(Cmyk::new(m[0], m[1], m[2], m[3])),
|
||||
ColorSpace::D65Gray => Color::Luma(Luma::new(m[0], m[1])),
|
||||
ColorSpace::D65Gray => Color::Luma(Luma::new(m[0], m[3])),
|
||||
})
|
||||
}
|
||||
|
||||
|
BIN
tests/ref/issue-color-mix-luma.png
Normal file
BIN
tests/ref/issue-color-mix-luma.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 126 B |
@ -329,3 +329,7 @@
|
||||
#color.hsl(blue) \
|
||||
#color.hsv(blue) \
|
||||
#luma(blue)
|
||||
|
||||
--- issue-color-mix-luma ---
|
||||
// When mixing luma colors, we accidentally used the wrong component.
|
||||
#rect(fill: gradient.linear(black, silver, space: luma))
|
||||
|
Loading…
x
Reference in New Issue
Block a user