Skip to content

Commit 79d6ca5

Browse files
Merge pull request #303 from jfboeve/master
fix(Colors) alpha calculation increase precision
2 parents 6d23940 + 57c59cb commit 79d6ca5

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)