diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-07-02 19:59:52 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-07-02 20:07:43 +0200 |
| commit | ebfdb1dafa430786db10dad2ef7d5467c1bdbed1 (patch) | |
| tree | 2bbc24ddb4124c4bb14dec0e536129d4de37b056 /crates/typst-library/src/visualize/mod.rs | |
| parent | 3ab19185093d7709f824b95b979060ce125389d8 (diff) | |
Move everything into `crates/` directory
Diffstat (limited to 'crates/typst-library/src/visualize/mod.rs')
| -rw-r--r-- | crates/typst-library/src/visualize/mod.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/crates/typst-library/src/visualize/mod.rs b/crates/typst-library/src/visualize/mod.rs new file mode 100644 index 00000000..ea873f44 --- /dev/null +++ b/crates/typst-library/src/visualize/mod.rs @@ -0,0 +1,45 @@ +//! Drawing and visualization. + +mod image; +mod line; +mod path; +mod polygon; +mod shape; + +pub use self::image::*; +pub use self::line::*; +pub use self::path::*; +pub use self::polygon::*; +pub use self::shape::*; + +use crate::prelude::*; + +/// Hook up all visualize definitions. +pub(super) fn define(global: &mut Scope) { + global.define("image", ImageElem::func()); + global.define("line", LineElem::func()); + global.define("rect", RectElem::func()); + global.define("square", SquareElem::func()); + global.define("ellipse", EllipseElem::func()); + global.define("circle", CircleElem::func()); + global.define("polygon", PolygonElem::func()); + global.define("path", PathElem::func()); + global.define("black", Color::BLACK); + global.define("gray", Color::GRAY); + global.define("silver", Color::SILVER); + global.define("white", Color::WHITE); + global.define("navy", Color::NAVY); + global.define("blue", Color::BLUE); + global.define("aqua", Color::AQUA); + global.define("teal", Color::TEAL); + global.define("eastern", Color::EASTERN); + global.define("purple", Color::PURPLE); + global.define("fuchsia", Color::FUCHSIA); + global.define("maroon", Color::MAROON); + global.define("red", Color::RED); + global.define("orange", Color::ORANGE); + global.define("yellow", Color::YELLOW); + global.define("olive", Color::OLIVE); + global.define("green", Color::GREEN); + global.define("lime", Color::LIME); +} |
