summaryrefslogtreecommitdiff
path: root/crates/typst-docs/src/lib.rs
diff options
context:
space:
mode:
authorLynn <lynn@foldr.moe>2023-07-05 11:26:50 +0200
committerGitHub <noreply@github.com>2023-07-05 11:26:50 +0200
commit9a9da806656fe70dde8827f8afc5dd9dac8f7cb0 (patch)
treec93422b364a759297771e9718745db935a8b14fa /crates/typst-docs/src/lib.rs
parent5fdd62141ff1dd19917e93b60f4dff5884be2020 (diff)
Color mixing function (#1332)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-docs/src/lib.rs')
-rw-r--r--crates/typst-docs/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/typst-docs/src/lib.rs b/crates/typst-docs/src/lib.rs
index 4f2c72b7..7ed6dcfe 100644
--- a/crates/typst-docs/src/lib.rs
+++ b/crates/typst-docs/src/lib.rs
@@ -40,6 +40,11 @@ static FONTS: Lazy<(Prehashed<FontBook>, Vec<Font>)> = Lazy::new(|| {
static LIBRARY: Lazy<Prehashed<Library>> = Lazy::new(|| {
let mut lib = typst_library::build();
+ // Hack for documenting the `mix` function in the color module.
+ // Will be superseded by proper associated functions.
+ lib.global
+ .scope_mut()
+ .define("mix", typst_library::compute::mix_func());
lib.styles
.set(PageElem::set_width(Smart::Custom(Abs::pt(240.0).into())));
lib.styles.set(PageElem::set_height(Smart::Auto));