diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/color.rs | 6 | ||||
| -rw-r--r-- | src/lib.rs | 4 | ||||
| -rw-r--r-- | src/paper.rs | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/color.rs b/src/color.rs index 66810537..35b90e8a 100644 --- a/src/color.rs +++ b/src/color.rs @@ -40,6 +40,12 @@ pub struct RgbaColor { } impl RgbaColor { + /// Black color. + pub const BLACK: Self = Self { r: 0, g: 0, b: 0, a: 255 }; + + /// White color. + pub const WHITE: Self = Self { r: 255, g: 255, b: 255, a: 255 }; + /// Constructs a new RGBA color. pub fn new(r: u8, g: u8, b: u8, a: u8) -> Self { Self { r, g, b, a } @@ -12,8 +12,8 @@ //! This produces a [layout tree], a high-level, fully styled representation. //! The nodes of this tree are self-contained and order-independent and thus //! much better suited for layouting than the syntax tree. -//! - **Layouting:** Next, the tree is to [layouted] into a portable version of -//! the typeset document. The output of this is a vector of [`Frame`]s +//! - **Layouting:** Next, the tree is [layouted] into a portable version of the +//! typeset document. The output of this is a vector of [`Frame`]s //! (corresponding to pages), ready for exporting. //! - **Exporting:** The finished layout can be exported into a supported //! format. Submodules for these formats are located in the [export] module. diff --git a/src/paper.rs b/src/paper.rs index bbe07803..58d87be1 100644 --- a/src/paper.rs +++ b/src/paper.rs @@ -39,7 +39,7 @@ impl PaperClass { /// The default margins for this page class. pub fn default_margins(self) -> Sides<Linear> { let f = |r| Relative::new(r).into(); - let s = |l, r, t, b| Sides::new(f(l), f(r), f(t), f(b)); + let s = |l, t, r, b| Sides::new(f(l), f(t), f(r), f(b)); match self { Self::Custom => s(0.1190, 0.0842, 0.1190, 0.0842), Self::Base => s(0.1190, 0.0842, 0.1190, 0.0842), |
