Skip to content

Commit

Permalink
Actually allow uppercase colour codes
Browse files Browse the repository at this point in the history
  • Loading branch information
maddy committed Mar 16, 2024
1 parent daf7be2 commit bf52b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/input/color/ColorModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const ColorModel = types
}

const [, red = 0, green = 0, blue = 0] =
/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/
/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i
.exec(hex)
?.map(hex => Number.parseInt(hex.toLowerCase(), 16)) ?? []
?.map(hex => Number.parseInt(hex, 16)) ?? []

const max = Math.max(red, blue, green)
const min = Math.min(red, blue, green)
Expand Down

0 comments on commit bf52b4d

Please sign in to comment.