summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/visualize/color.rs2
-rw-r--r--tests/suite/visualize/color.typ2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst/src/visualize/color.rs b/crates/typst/src/visualize/color.rs
index 17f4b5a4..52706a96 100644
--- a/crates/typst/src/visualize/color.rs
+++ b/crates/typst/src/visualize/color.rs
@@ -1721,7 +1721,7 @@ impl Cmyk {
}
fn from_luma(luma: Luma) -> Self {
- let l = luma.luma;
+ let l = 1.0 - luma.luma;
Cmyk::new(l * 0.75, l * 0.68, l * 0.67, l * 0.90)
}
diff --git a/tests/suite/visualize/color.typ b/tests/suite/visualize/color.typ
index da93cb4e..45000ab2 100644
--- a/tests/suite/visualize/color.typ
+++ b/tests/suite/visualize/color.typ
@@ -117,7 +117,7 @@
#test-repr(cmyk(4%, 5%, 6%, 7%).to-hex(), "#e0dcda")
#test-repr(rgb(cmyk(4%, 5%, 6%, 7%)), rgb(87.84%, 86.27%, 85.49%, 100%))
#test-repr(rgb(luma(40%)), rgb(40%, 40%, 40%))
-#test-repr(cmyk(luma(40)), cmyk(11.76%, 10.67%, 10.51%, 14.12%))
+#test-repr(cmyk(luma(40)), cmyk(63.24%, 57.33%, 56.49%, 75.88%))
#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%))
#test-repr(color.hsl(luma(40)), color.hsl(0deg, 0%, 15.69%))