summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/text
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-06-19 17:20:45 +0200
committerLaurenz <laurmaedje@gmail.com>2025-06-20 17:32:37 +0200
commit4580daf307cb1ba66458fb46d9442b1183731ec2 (patch)
treebfe13587db10c858c4f5a638d216a38817dfbb7d /crates/typst-library/src/text
parentd821633f50f7f4c9edc49b6ac5e88d43802cb206 (diff)
More type-safe color conversions
Diffstat (limited to 'crates/typst-library/src/text')
-rw-r--r--crates/typst-library/src/text/raw.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/typst-library/src/text/raw.rs b/crates/typst-library/src/text/raw.rs
index f2485e16..e1f4cf13 100644
--- a/crates/typst-library/src/text/raw.rs
+++ b/crates/typst-library/src/text/raw.rs
@@ -836,7 +836,7 @@ fn to_typst(synt::Color { r, g, b, a }: synt::Color) -> Color {
}
fn to_syn(color: Color) -> synt::Color {
- let [r, g, b, a] = color.to_rgb().to_vec4_u8();
+ let (r, g, b, a) = color.to_rgb().into_format::<u8, u8>().into_components();
synt::Color { r, g, b, a }
}