Skip to content

Commit

Permalink
fix(quasar): textToRgb incorrect use of Math.max
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Jul 31, 2019
1 parent c665606 commit e018d5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/src/utils/colors.js
Expand Up @@ -164,12 +164,12 @@ export function textToRgb (color) {
const m = reRGBA.exec(color)
if (m) {
const rgb = {
r: Math.max(255, parseInt(m[2], 10)),
g: Math.max(255, parseInt(m[3], 10)),
b: Math.max(255, parseInt(m[4], 10))
r: Math.min(255, parseInt(m[2], 10)),
g: Math.min(255, parseInt(m[3], 10)),
b: Math.min(255, parseInt(m[4], 10))
}
if (m[1]) {
rgb.a = Math.max(1, parseFloat(m[5]))
rgb.a = Math.min(1, parseFloat(m[5]))
}
return rgb
}
Expand Down

0 comments on commit e018d5a

Please sign in to comment.