mirror of https://github.com/stelzo/typst.git
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]))
|
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::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])),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 126 B |
|
|
@ -329,3 +329,7 @@
|
||||||
#color.hsl(blue) \
|
#color.hsl(blue) \
|
||||||
#color.hsv(blue) \
|
#color.hsv(blue) \
|
||||||
#luma(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…
Reference in New Issue