added rgbToValues util

This commit is contained in:
SrGooglo 2023-10-10 12:16:58 +00:00
parent 2ba7bcece2
commit 9b7edd87d1

View File

@ -0,0 +1,11 @@
function RGBStringToValues(rgbString) {
if (!rgbString) {
return [0, 0, 0]
}
const rgb = rgbString.replace("rgb(", "").replace(")", "").split(",").map((v) => parseInt(v))
return [rgb[0], rgb[1], rgb[2]]
}
export default RGBStringToValues