Files
MrForExample b4e136aa55 Update preview nodes
- Support custom background color in preview node
- Fix Preview node does not update automatically with same mesh name
- Add system config file that allow custom clients IP address
2024-03-10 20:25:05 +01:00

14 lines
404 B
JavaScript

export function getRGBValue(colorString="rgb(0, 0, 0)", scale01=false) {
var color = colorString.split(/[\D]+/).filter(Boolean)
for (let index = 0; index < color.length; index++) {
color[index] = Number(color[index]);
}
if (scale01) {
for (let index = 0; index < color.length; index++) {
color[index] = color[index] / 255;
}
}
return color;
}