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
Copy file name to clipboardExpand all lines: docs/colophon.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ title: Colophon
4
4
menu-order: 6
5
5
---
6
6
7
-
Developed by [Dan Burzo](http://danburzo.ro) with the help of many collaborators, and released under the MIT license. The library is indebted to Mike Bostock's [D3.js](https://github.com/d3) and Gregor Aisch's [chroma.js](https://github.com/gka/chroma.js). D3, in particular, has been a treasure-trove of ideas and academic references.
7
+
Culori is developed by [Dan Burzo](http://danburzo.ro) with the help of many collaborators, and released under the MIT license.
8
8
9
-
Culori is the Romanian word for ‘colors’. The logo is typeset in [Hatch](https://pstypelab.com/hatchfont) by Mark Caneso.
9
+
The library has been inspired by Mike Bostock's [D3.js](https://github.com/d3) and Gregor Aisch's [chroma.js](https://github.com/gka/chroma.js): they have popularized color science in the browser and provided a blueprint for a color manipulation API. I have learned a tremendous amount by reading through the documentation the source code while developing Culori. D3, in particular, has been a treasure trove of ideas and pointers to academic references.
10
+
11
+
I pronounce the name of the library as [[kuːlori]](http://ipa-reader.xyz/?text=ku%CB%90lori). Culori is the Romanian word for ‘colors’. The logo is typeset in [Hatch](https://pstypelab.com/hatchfont) by Mark Caneso.
10
12
11
-
The code is formatted with [Prettier](https://prettier.io), upkeeped with [ESLint](https://eslint.org/), tested with [tape](https://github.com/substack/tape), and bundled with [esbuild](https://esbuild.github.io/).
12
-
13
-
This website is statically generated using [Eleventy](https://11ty.dev) and published to GitHub Pages.
13
+
The code is formatted with [Prettier](https://prettier.io), upkept with [ESLint](https://eslint.org/), tested with [tape](https://github.com/ljharb/tape), and bundled with [esbuild](https://esbuild.github.io/). This website is statically generated using [Eleventy](https://11ty.dev) and published to GitHub Pages.
For code that runs in browsers, you may want to streamline the bundle to only include the parts of Culori you're using. See [Optimize bundle size with tree-shaking](/guides/tree-shaking/) for guidance on switching your imports to use `'culori/fn'` instead of `'culori'` once you're done prototyping.
25
+
24
26
## Fetch Culori from a CDN
25
27
26
28
You can use Culori from your favorite Content Delivery Network to create quick prototypes in HTML. Here are a few popular choices:
@@ -53,11 +55,7 @@ Use it as an ES module:
53
55
54
56
### In your browser's console
55
57
56
-
The library is added to every page of this website, so you can try the API in your browser's console as you read through the examples.
57
-
58
-
### Runkit
59
-
60
-
You can also use Culori in the Runkit npm playground ([npm.runkit.com/culori](https://npm.runkit.com/culori)) to test the API without installing anything.
58
+
The library is available on this website as the global variable `culori`, so can try the API in your browser's console as you read through the examples.
Copy file name to clipboardExpand all lines: docs/guides/migration.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Migration guide'
3
3
---
4
4
5
-
## Migrating from version 2.x to 3.0
5
+
## From v2 to v3
6
6
7
7
### Custom identifiers removed from the `color()` syntax
8
8
@@ -35,7 +35,7 @@ The parsing of the [modern syntax](https://w3c.github.io/csswg-drafts/css-color-
35
35
*`parseRgbLegacy()` has been added to the API to parse the legacy `rgb()` / `rgba()` syntax
36
36
*`parseHslLegacy()` has been added to the API to parse the legacy `hsl()` / `hsla()` syntax
37
37
38
-
## Migrating from version 1.x to 2.0
38
+
## From v1 to v2
39
39
40
40
* all color components in all CSS color syntaxes now accept the `none` keyword. ([w3c/csswg-drafts#6107](https://github.com/w3c/csswg-drafts/issues/6107))
41
41
@@ -124,7 +124,7 @@ lch(75 50 15deg)
124
124
In version 2.0, we drop this quirk and bring Culori in line with the specification.
Copy file name to clipboardExpand all lines: docs/guides/tree-shaking.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
title: 'Optimize bundle size with tree-shaking'
3
3
---
4
4
5
-
The default `culori` import comes with the full set of color spaces and functions to let you prototype quickly and with fewer errors.
5
+
The default `culori` import comes with the full set of color spaces and functions to let you prototype quickly and with fewer errors. However, the way color spaces are initialized prevents the library from being tree-shaken, so when you use a bundler (such as [esbuild](https://esbuild.github.io/), [Vite](https://vitejs.dev/), or [Parcel](https://parceljs.org/)), the entire Culori library is bundled regardless of what you're actually using.
6
6
7
-
However, the way color spaces are initialized prevents the library from being tree-shaken, so when you use a bundler such as Webpack or Parcel, the entire Culori library is bundled regardless of what you're actually using.
7
+
This guides walks you through switching your imports to the tree-shakeable version once you're done prototyping and you're ready to ship an optimized bundle.
For convenience, a couple of bootstrap packages are available.
104
110
105
-
### `culori/css`
111
+
<h3id='culori-css'><code>culori/css</code></h3>
106
112
107
113
Bootstrap all the color spaces available in CSS, plus a handful of related ones we get for free, since they are used under the hood.
108
114
109
-
It provides the following named exports: `a98`, `hsl`, `hsv`, `hwb`, `lab`, `lab65`, `lch`, `lch65`, `lrgb`, `p3`, `prophoto`, `rec2020`, `rgb`, `xyz50`, and `xyz65`.
115
+
It provides the following named exports: `a98`, `hsl`, `hsv`, `hwb`, `lab`, `lab65`, `lch`, `lch65`, `lrgb`, `oklab`, `oklch`, `p3`, `prophoto`, `rec2020`, `rgb`, `xyz50`, and `xyz65`.
110
116
111
117
```js
112
118
import'culori/css';
@@ -125,5 +131,5 @@ It provides the following named exports: `a98`, `cubehelix`, `dlab`, `dlch`, `hs
Culori is a color library for JavaScript that supports most color spaces and formats defined in the [CSS Colors Level 4][css4-colors] specification ([named colors][css4-named-colors], [hex colors][hex-colors] with 3 to 8 digits, [RGB][rgb-colors], [HSL][hsl-colors], [HWB][hwb-colors], [Lab and LCh][lab-colors]), plus [additional color spaces](./color-spaces).
17
-
18
-
It handles [color differences](https://en.wikipedia.org/wiki/Color_difference), interpolation, gradients, blend modes [and more](./api).
17
+
Culori is a JavaScript color library that supports the conversion and manipulation of all formats defined in the [CSS Colors Level 4][css4-colors] specification, plus [additional color spaces](./color-spaces). It handles [color differences](https://en.wikipedia.org/wiki/Color_difference), interpolation, gradients, blend modes [and much more](/api/).
0 commit comments