You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#showlink: settext(fill: blue, font: "Source Sans Pro", size: 12pt)
11
11
#showref: settext(fill: blue, font: "Source Sans Pro", size: 12pt)
@@ -36,7 +36,7 @@
36
36
37
37
// End of setup
38
38
39
-
= CSS Colors Module
39
+
= The `css-colors` Package
40
40
41
41
== History
42
42
@@ -81,9 +81,9 @@ The CSS Level 1 colors introduced in 1996 specified these same sixteen colors, w
81
81
=== SVG/CSS colors
82
82
83
83
Finally, the #link("https://www.w3.org/TR/SVG11/types.html#ColorKeywords")[SVG 1.1 Specification] of 2011 #cite(<SVG11>) and the #link("https://www.w3.org/TR/css-color-3/#html4")[CSS Color Module Level 3] #cite(<CSS3>) of
84
-
2022 have standardized on a list of 147 color names, known as the "recognized color keyword names" or the "extended color keywords" respectively. They include the original 16 colors, augmented by `orange`, and additional colors from the X11 set. These colors---common to both the CSS and SVG standards---are referred to as the CSS Colors in this manual and module.
84
+
2022 have standardized on a list of 147 color names, known as the "recognized color keyword names" or the "extended color keywords" respectively. They include the original 16 colors, augmented by `orange`, and additional colors from the X11 set. These colors---common to both the CSS and SVG standards---are referred to as the CSS colors in this manual and package.
85
85
86
-
This standardization aims to provide a consistent color naming scheme across the Web, and has remained relatively stable. It is this set of color names that forms the basis for this module. How the CSS colors were given their rather idiosyncratic names is explained in a lighthearted but factual fashion by Alex Sexton in this #link("https://www.youtube.com/watch?v=HmStJQzclHc")[this You Tube video] #cite(<CSShistory>).
86
+
This standardization aims to provide a consistent color naming scheme across the Web, and has remained relatively stable. It is this set of color names that forms the basis for this package. How the CSS colors were given their rather idiosyncratic names is explained in a lighthearted but factual fashion by Alex Sexton in this #link("https://www.youtube.com/watch?v=HmStJQzclHc")[this You Tube video] #cite(<CSShistory>).
87
87
88
88
There are 147 "recognized CSS color keyword names" all of which are unique. But of these, only 138 have unique Hex values. This means that there are nine pairs of named colors that share the same hex value as shown in @css-colors-sharing-hex-value.
89
89
@@ -94,9 +94,9 @@ Typst ships with #link("https://typst.app/docs/reference/visualize/color/#predef
94
94
The remaining seventeen colors have identical names, but---with the exception of `white` and `black`---they
95
95
have different RGB/Hex values, as shown in @comparison-typst-css-colors.
96
96
97
-
== Purpose of Module
97
+
== Purpose of Package
98
98
99
-
The CSS Colors Module is a robust convenience which allows #link("https://www.w3.org/TR/css-color-3/#svg-color")[CSS/SVG colors] to be used by their names within a Typst file, rather than by their RGB/Hex codes, which have to be looked up.
99
+
The `css-colors` package is a robust convenience which allows #link("https://www.w3.org/TR/css-color-3/#svg-color")[CSS/SVG colors] to be used by their names within a Typst file, rather than by their RGB/Hex codes, which have to be looked up.
100
100
101
101
== Easy Reference
102
102
@@ -108,7 +108,7 @@ You may also view them in a browser by clicking on this #link("https://htmlprevi
108
108
109
109
=== Function
110
110
111
-
The CSS Colors Module provides a function `css` defined as:
111
+
The `css-colors` package provides a single function `css` defined as:
112
112
113
113
```typ
114
114
css(
@@ -132,9 +132,9 @@ Since the returned value is of type `color`, it can be used with any of Typst's
132
132
133
133
== Usage
134
134
135
-
The following examples demonstrate the usage of the CSS colors module in various cases:
135
+
The following examples demonstrate the usage of the `css-colors` package in various cases:
136
136
137
-
+ Coloring text.
137
+
+ Coloring text with a CSS color.
138
138
139
139
```typ
140
140
#import "@preview/css-colors:0.1.0": *
@@ -144,7 +144,7 @@ The following examples demonstrate the usage of the CSS colors module in various
144
144
145
145
Normal text may be #text(fill: css("crimson"))[colored so.]
146
146
147
-
+ A rectangle may be colored with `fill`.
147
+
+ Filling a rectangle with a CSS color.
148
148
149
149
```typ
150
150
#import "@preview/css-colors:0.1.0": *
@@ -154,7 +154,7 @@ The following examples demonstrate the usage of the CSS colors module in various
+ The maroon color in Typst differs from the Maroon color defined in CSS, as evidenced by their distinct hex codes. To emphasize this distinction, the CSS `Maroon` is intentionally capitalized with an initial uppercase letter.
171
+
+ The maroon color in Typst differs from the Maroon color defined in CSS, as evidenced by their distinct hex codes. To emphasize this distinction, the CSS `Maroon` is intentionally capitalized with an initial uppercase letter.
172
172
173
173
```typ
174
174
#import "@preview/css-colors:0.1.0": *
@@ -211,13 +211,12 @@ The following examples demonstrate the usage of the CSS colors module in various
0 commit comments