Skip to content

Commit 7a5077e

Browse files
committed
Prepare for 0.6.3
1 parent 3e647a8 commit 7a5077e

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.6.3 (2024-02-06)
4+
5+
- Fix values returned by `getAsymmetricDivergingColors` and `getSequentialColors`.
6+
37
## 0.6.2 (2024-02-06)
48

59
- Fix values returned by `getAsymmetricDivergingColors` and `getSequentialColors` to always be hexadecimals (instead of mixed hexadecimals and RGB strings).

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dicopal",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "Discrete color palettes for cartography and data visualization",
55
"homepage": "https://github.com/riatelab/dicopal.js",
66
"repository": {

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export const getRawData = (provider?: Provider) => {
278278
* @returns {string} - The hexadecimal color
279279
*/
280280
const rgbToHex = (rgbString: string): string => {
281+
if (rgbString.startsWith('#')) return rgbString;
281282
const [r, g, b] = rgbString.match(/\d+/g)!.map((x) => parseInt(x, 10));
282283
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
283284
}

0 commit comments

Comments
 (0)