Skip to content

Commit 8fa04c5

Browse files
hawkeye64rstoenescu
authored andcommitted
fix(colors): blend alpha after textToRgb is 0-100 (quasarframework#6095)
1 parent ac20fde commit 8fa04c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/src/utils/colors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ export function blend (fgColor, bgColor) {
241241
r1 = rgb1.r / 255,
242242
g1 = rgb1.g / 255,
243243
b1 = rgb1.b / 255,
244-
a1 = rgb1.a !== void 0 ? rgb1.a / 255 : 1,
244+
a1 = rgb1.a !== void 0 ? rgb1.a / 100 : 1,
245245
rgb2 = typeof bgColor === 'string' ? textToRgb(bgColor) : bgColor,
246246
r2 = rgb2.r / 255,
247247
g2 = rgb2.g / 255,
248248
b2 = rgb2.b / 255,
249-
a2 = rgb2.a !== void 0 ? rgb2.a / 255 : 1,
249+
a2 = rgb2.a !== void 0 ? rgb2.a / 100 : 1,
250250
a = a1 + a2 * (1 - a1),
251251
r = Math.round(((r1 * a1 + r2 * a2 * (1 - a1)) / a) * 255),
252252
g = Math.round(((g1 * a1 + g2 * a2 * (1 - a1)) / a) * 255),

0 commit comments

Comments
 (0)