Skip to content

Commit 57c59cb

Browse files
committed
fix(Colors) alpha calculation increase precision
1 parent 6d23940 commit 57c59cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Colors/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const calculateAlpha = (argb, p) => {
6363
let r = ((argb / 65536) | 0) % 256
6464
let g = ((argb / 256) | 0) % 256
6565
let b = argb % 256
66-
return (r << 16) + (g << 8) + b + ((p * 255) | 0) * 16777216
66+
return (r << 16) + (g << 8) + b + (Math.round(p * 255) | 0) * 16777216
6767
}
6868

6969
export const mergeColorAlpha = (c, alpha) => {

0 commit comments

Comments
 (0)