Skip to content

Commit

Permalink
bug fix for rgb bars
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Feb 8, 2024
1 parent 0354156 commit ccdb1c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/colorbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}% ${
Expand Down

0 comments on commit ccdb1c3

Please sign in to comment.