Archmage.Rgba
Converts between Color, the type of an rgba field, and the format of the config files.
Inherits: RefCounted
In the config files, a color is "#RRGGBB" when it is opaque, "#RRGGBBAA" otherwise, and "" or null when every channel is 0. Color keeps each 8-bit channel exactly, so a color that is read and then written does not change.
Methods
Section titled “Methods”from_json()
Section titled “from_json()”static func from_json(v: Variant, e: Archmage.ParseError = null) -> ColorReturns the color in v, a parsed JSON value. For null and "", returns Color(0, 0, 0, 0). For any other value that is not "#RRGGBB" or "#RRGGBBAA", records the error in e (see Archmage.ParseError.report()) and returns Color(0, 0, 0, 0).
to_json()
Section titled “to_json()”static func to_json(c: Color) -> StringReturns c in the format of the config files, with uppercase hex digits. Each channel is rounded to 8 bits.