Skip to content

Commit e85e0c8

Browse files
committed
fix(quasar): textToRgb incorrect use of Math.max
close quasarframework#4770
1 parent 82fc6eb commit e85e0c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/src/utils/colors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ export function textToRgb (color) {
164164
const m = reRGBA.exec(color)
165165
if (m) {
166166
const rgb = {
167-
r: Math.max(255, parseInt(m[2], 10)),
168-
g: Math.max(255, parseInt(m[3], 10)),
169-
b: Math.max(255, parseInt(m[4], 10))
167+
r: Math.min(255, parseInt(m[2], 10)),
168+
g: Math.min(255, parseInt(m[3], 10)),
169+
b: Math.min(255, parseInt(m[4], 10))
170170
}
171171
if (m[1]) {
172-
rgb.a = Math.max(1, parseFloat(m[5]))
172+
rgb.a = Math.min(1, parseFloat(m[5]))
173173
}
174174
return rgb
175175
}

0 commit comments

Comments
 (0)