Color fromAny

From Catglobe Wiki
Jump to: navigation, search
  • Color Color_fromAny(object color "Object to convert to color") - Create new color object from anything that can be converted, E.g. {255,0,0}, {255,0,0,32}, "pink", "#FF0000", new Color("pink", false)
Color c = Color_fromAny("pink");
//Color c = Color_fromAny({255,192,203});
//Color c = Color_fromAny("#ffc0cb");
//Color c = Color_fromAny(new Color ("pink",false));
print(c.Red);//255
print(c.Green);//192
print(c.Blue);//203
print(c.HtmlRgbHex);//#ffc0cb