Skip to content

Commit 78dc682

Browse files
koenpuntbhough
authored andcommitted
remove unnecessary division by 1
These were probably remnants from taking the sass formula, where it describes the weight in a value of 0 to 100, and it was divided by 100.
1 parent 0a411b6 commit 78dc682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/color/mix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function mix(weight: number | string, color: string, otherColor: string): string
5959
green: Math.floor(color1.green * weight1 + color2.green * weight2),
6060
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
6161
alpha:
62-
color1.alpha * (parseFloat(weight) / 1.0) + color2.alpha * (1 - parseFloat(weight) / 1.0),
62+
color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight)),
6363
}
6464

6565
return rgba(mixedColor)

0 commit comments

Comments
 (0)