Skip to content

Commit 635182a

Browse files
authored
Merge pull request #7962 from plotly/cam/7961/switch-to-culori-library
feat: Switch to culori color library
2 parents fcf6e99 + 1b5ad5e commit 635182a

63 files changed

Lines changed: 1230 additions & 516 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

draftlogs/7962_change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- **Breaking**: Switch color processing library from [color](https://github.com/Qix-/color) to [culori](https://culorijs.org) [[#7962](https://github.com/plotly/plotly.js/pull/7962)]
2+
- Additional CSS Color 4 formats are now supported: `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`, `hsl(0.5turn 60% 40%)`, `hsl(none 60% 40%)`
3+
- `rgb()` now accepts an optional alpha, so `rgb(255, 0, 0, 0.5)` is no longer opaque (`rgb` and `rgba` are aliases per [spec](https://www.w3.org/TR/css-color-4/#changes-from-3))
4+
- Color strings that are not valid CSS are now rejected, including `hwb(200, 10%, 20%)` and `hsl(120, 50% 50%)`
5+
- Contrasting text and border colors are picked by WCAG contrast ratio, so labels on saturated mid-tone fills may switch from dark to white

package-lock.json

Lines changed: 10 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@
7474
"@turf/centroid": "^7.3.5",
7575
"@turf/meta": "^7.3.5",
7676
"base64-arraybuffer": "^1.0.2",
77-
"color": "^5.0.3",
78-
"color-normalize": "^1.5.2",
7977
"country-iso-search": "^0.1.1",
78+
"culori": "^4.0.2",
8079
"d3-force": "^1.2.1",
8180
"d3-format": "^1.4.5",
8281
"d3-geo": "^1.12.1",
@@ -158,9 +157,6 @@
158157
"virtual-webgl": "^1.0.7"
159158
},
160159
"overrides": {
161-
"color": {
162-
"color-string": "^2.1.4"
163-
},
164160
"falafel": {
165161
"acorn": "^8.1.1"
166162
},

0 commit comments

Comments
 (0)