Skip to content

Commit

Permalink
Fix rgb alpha percentage parsing from int to float
Browse files Browse the repository at this point in the history
  • Loading branch information
clytras authored and Qix- committed Nov 30, 2021
1 parent ab299a7 commit 0710543
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cs.get.rgb = function (string) {

if (match[4]) {
if (match[5]) {
rgb[3] = parseInt(match[4], 0) * 0.01;
rgb[3] = parseFloat(match[4]) * 0.01;
} else {
rgb[3] = parseFloat(match[4]);
}
Expand All @@ -102,7 +102,7 @@ cs.get.rgb = function (string) {

if (match[4]) {
if (match[5]) {
rgb[3] = parseInt(match[4], 0) * 0.01;
rgb[3] = parseFloat(match[4]) * 0.01;
} else {
rgb[3] = parseFloat(match[4]);
}
Expand Down

0 comments on commit 0710543

Please sign in to comment.