Closed aquilesalacruz closed 3 years ago
@aquilesalacruz This component supports only (3 or 6) hex-color (no transparency at all).
So, you could use following snippets to be able to use RGB values ;)
function valToHex(c) {
return (c).toString(16).padStart(2, '0');
}
function rgbToHex(r, g, b) {
return `#${valToHex(r)}${valToHex(g)}${valToHex(b)}`;
}
<Switch onColor={rgbToHex(255,0,0)} />
For some reason if I use
rgb(255, 255, 255)
as theonHandleColor
oroffHandleColor
it's taken astransparent
on the initial render. This does not happen if I use#FFF
as the value instead.