fixed rgbToHex rounding

This commit is contained in:
Lily-129 2022-04-19 09:05:37 -04:00 committed by GitHub
parent 56581d12fa
commit f9cdd92e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -116,11 +116,11 @@ function _rgbToHex(color) {
//console.log("Splitting string")
color = color.split(",");
//console.log("Getting R");
var red = parseInt(color[0].substring(4))
var red = parseFloat(color[0].substring(4))
//console.log("Getting G");
var green = parseInt(color[1])
var green = parseFloat(color[1])
//console.log("Getting B");
var blue = parseInt(color[2].slice(0,-1))
var blue = parseFloat(color[2].slice(0,-1))
//console.log("Rounding R");
red = Math.round(red);
//console.log("Rounding G");