So I have this function
if (colorString[0] == '#') {
const hex = colorString.replace('#', '');
let r = parseInt(hex.slice(0, 2), 16);
let g = parseInt(hex.slice(2, 4), 16);
let b = parseInt(hex.slice(4, 6), 16);
return color.rgb(r, g, b);
};
And I call it here:
screen.fillRect(posX, posY, width + padding * 2, height + padding * 2, Style.color(backgroundColor));
where screen.fillRect is a function that adds a handler to draw that rectangle every frame. But when I use the function the wrong colors appear. This can be minimized by multiplying by four, but it does still leave a lot of error. Is there a solution to this problem?