From ccdb1c30f30920b5f2150655e4faa1496ca6128f Mon Sep 17 00:00:00 2001 From: Shane Loeffler Date: Thu, 8 Feb 2024 14:30:53 -0600 Subject: [PATCH] bug fix for rgb bars --- package.json | 2 +- src/colorbar.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8144a96..8280a0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@carbonplan/components", - "version": "12.6.0", + "version": "12.6.1", "description": "shared components for our websites", "main": "dst/index.js", "module": "dst/index.esm.js", diff --git a/src/colorbar.js b/src/colorbar.js index 39557c2..882e4cd 100644 --- a/src/colorbar.js +++ b/src/colorbar.js @@ -37,7 +37,7 @@ const hexToRgb = (hex) => { const Gradient = ({ colormap, discrete, horizontal, width, height }) => { const step = (1 / colormap.length) * 100 - const isHex = colormap[0].startsWith('#') + const isHex = String(colormap[0]).startsWith('#') const values = colormap.map((color, i) => { const rgbColor = isHex ? hexToRgb(color) : color const position = `${i * step}% ${