summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-08-07 15:02:50 +0200
committerLaurenz <laurmaedje@gmail.com>2023-08-07 15:58:16 +0200
commit07c80e9a815750079b9a091fdc434ec498bc4cd0 (patch)
treef0ccb4472e1f6491212bf39509a5f947bfdeb5ef /docs
parent800744ed9d3923eecf3436f2029e77033e8f1b6a (diff)
Touch up docs
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/types.md36
1 files changed, 17 insertions, 19 deletions
diff --git a/docs/reference/types.md b/docs/reference/types.md
index 62c59cb0..429d41c2 100644
--- a/docs/reference/types.md
+++ b/docs/reference/types.md
@@ -87,9 +87,9 @@ Typst supports the following length units:
A length has the following fields:
-- `em`: The amount of `em` units in this length, as a [float]($type/float).
- `abs`: A length with just the absolute component of the current length
(that is, excluding the `em` component).
+- `em`: The amount of `em` units in this length, as a [float]($type/float).
You can multiply lengths with and divide them by integers and floats.
@@ -110,38 +110,34 @@ You can multiply lengths with and divide them by integers and floats.
### pt()
Converts this length to points.
-Fails with an error if this length has non-zero `em` units
-(such as `5em + 2pt` instead of just `2pt`). Use the `abs`
-field (such as in `(5em + 2pt).abs.pt()`) to ignore the
-`em` component of the length (thus converting only its
-absolute component).
+Fails with an error if this length has non-zero `em` units (such as `5em + 2pt`
+instead of just `2pt`). Use the `abs` field (such as in `(5em + 2pt).abs.pt()`)
+to ignore the `em` component of the length (thus converting only its absolute
+component).
- returns: float
### mm()
Converts this length to millimeters.
-Fails with an error if this length has non-zero `em` units
-(such as `5em + 2pt` instead of just `2pt`). See the
-[`pt()`]($type/float.pt) method for more info.
+Fails with an error if this length has non-zero `em` units (such as `5em + 2pt`
+instead of just `2pt`). See the [`pt`]($type/float.pt) method for more info.
- returns: float
### cm()
Converts this length to centimeters.
-Fails with an error if this length has non-zero `em` units
-(such as `5em + 2pt` instead of just `2pt`). See the
-[`pt()`]($type/float.pt) method for more info.
+Fails with an error if this length has non-zero `em` units (such as `5em + 2pt`
+instead of just `2pt`). See the [`pt`]($type/float.pt) method for more info.
- returns: float
### inches()
Converts this length to inches.
-Fails with an error if this length has non-zero `em` units
-(such as `5em + 2pt` instead of just `2pt`). See the
-[`pt()`]($type/float.pt) method for more info.
+Fails with an error if this length has non-zero `em` units (such as `5em + 2pt`
+instead of just `2pt`). See the [`pt`]($type/float.pt) method for more info.
- returns: float
@@ -235,7 +231,8 @@ Returns the constructor function for this color's kind
([`rgb`]($func/rgb), [`cmyk`]($func/cmyk) or [`luma`]($func/luma)).
```example
-#{cmyk(1%, 2%, 3%, 4%).kind() == cmyk}
+#let color = cmyk(1%, 2%, 3%, 4%)
+#(color.kind() == cmyk)
```
- returns: function
@@ -273,9 +270,10 @@ of [integers]($type/integer).
- returns: array
### cmyk()
-Converts this color to Digital CMYK and returns its components (C, M, Y, K) as an
-array of [ratio]($type/ratio). Note that this function will throw an error when
-applied to an [rgb]($func/rgb) color, since its conversion to CMYK is not available.
+Converts this color to Digital CMYK and returns its components (C, M, Y, K) as
+an array of [ratios]($type/ratio). Note that this function will throw an error
+when applied to an [rgb]($func/rgb) color, since its conversion to CMYK is not
+available.
- returns: array