We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82fc6eb commit e85e0c8Copy full SHA for e85e0c8
ui/src/utils/colors.js
@@ -164,12 +164,12 @@ export function textToRgb (color) {
164
const m = reRGBA.exec(color)
165
if (m) {
166
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))
+ r: Math.min(255, parseInt(m[2], 10)),
+ g: Math.min(255, parseInt(m[3], 10)),
+ b: Math.min(255, parseInt(m[4], 10))
170
}
171
if (m[1]) {
172
- rgb.a = Math.max(1, parseFloat(m[5]))
+ rgb.a = Math.min(1, parseFloat(m[5]))
173
174
return rgb
175
0 commit comments