added rgbToValues util

This commit is contained in:
SrGooglo 2023-10-10 12:16:58 +00:00
parent 4d4aaaaa2f
commit 7f23134574

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