summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-17 14:47:11 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-17 14:47:11 +0100
commit271b0f953b35ab2c0281b5f728798204accc412f (patch)
treefccfe3a0694eb2a84652ab541c08a438334fda60 /src
parentceb00a2e779ce17b75fd996b4e5f48ab543a1e63 (diff)
Fixes in TextMate grammar ✅
Diffstat (limited to 'src')
-rw-r--r--src/color.rs6
-rw-r--r--src/lib.rs4
-rw-r--r--src/paper.rs2
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 }
diff --git a/src/lib.rs b/src/lib.rs
index c8d41317..d4a73ed4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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),