Skip to content

Commit 6b143ce

Browse files
authored
Merge pull request #7536 from plotly/cam/7523/switch-color-library
feat: Switch color processing library
2 parents 795d546 + a415430 commit 6b143ce

79 files changed

Lines changed: 1271 additions & 957 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.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ build/*
77
dist/*.LICENSE.txt
88
dist/*.css
99

10+
# Ignore local dev mocks/baselines
11+
test/image/**/dev_*.*
12+
1013
npm-debug.log*
1114
*.sublime*
1215
*~

draftlogs/7536_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 [TinyColor](https://github.com/bgrins/TinyColor) to [color](https://github.com/Qix-/color) [[#7536](https://github.com/plotly/plotly.js/pull/7536)]
2+
- `rgb()`/`rgba()` strings with decimal 0–1 fractions are no longer supported
3+
- `hsv()` color strings are no longer permitted
4+
- Color calculations may differ slightly (by a few RGB units)
5+
- New color formats are now supported: '#ff0000aa', '#f00a', 'rgb(255 0 0)', 'rgba(255 0 0 / 0.5)', 'hsl(0 100% 50% / 0.5)', 'hsla(0, 100%, 50%, 0.5)', 'hwb(0, 0%, 0%)'
File renamed without changes.

package-lock.json

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

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"@turf/bbox": "^7.1.0",
8181
"@turf/centroid": "^7.1.0",
8282
"base64-arraybuffer": "^1.0.2",
83+
"color": "^5.0.0",
8384
"color-normalize": "1.5.0",
8485
"color-rgba": "3.0.0",
8586
"country-regex": "^1.1.0",
@@ -110,7 +111,6 @@
110111
"regl-splom": "^1.0.14",
111112
"strongly-connected-components": "^1.0.1",
112113
"svg-path-sdf": "^1.1.3",
113-
"tinycolor2": "^1.4.2",
114114
"topojson-client": "^3.1.0",
115115
"webgl-context": "^2.2.0",
116116
"world-calendars": "^1.0.4"
@@ -176,6 +176,9 @@
176176
"virtual-webgl": "^1.0.7"
177177
},
178178
"overrides": {
179+
"color": {
180+
"color-string": "^2.1.4"
181+
},
179182
"falafel": {
180183
"acorn": "^8.1.1"
181184
}

src/components/color/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ exports.borderLine = '#BEC8D9';
2525

2626
// with axis.color and Color.interp we aren't using lightLine
2727
// itself anymore, instead interpolating between axis.color
28-
// and the background color using tinycolor.mix. lightFraction
28+
// and the background color using Color.mix. lightFraction
2929
// gives back exactly lightLine if the other colors are defaults.
3030
exports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4);

0 commit comments

Comments
 (0)