From 071054385db7b3d772214e40f8683e51d1725299 Mon Sep 17 00:00:00 2001 From: Christos Lytras Date: Fri, 26 Nov 2021 14:20:59 +0200 Subject: [PATCH] Fix rgb alpha percentage parsing from int to float --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 90044c1..83ce40e 100644 --- a/index.js +++ b/index.js @@ -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]); } @@ -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]); }