Skip to content

XUIColorGroupExtensions

Description

This module contains helper methods for dealing with ColorGroups.

Methods

Name Parameters Returns
Dark cg As ColorGroup Color
FromString s As String ColorGroup
Light cg As ColorGroup Color
ToString cg As ColorGroup String
ToTOML cg As ColorGroup String

Method Descriptions

Dark(cg As ColorGroup) As Color

If cg has a dark colour defined it is returned otherwise the light colour is returned.


FromString(s As String) As ColorGroup

Returns a new ColorGroup from s. Raises an InvalidArgumentException if s is incorrectly formatted.

s may be in one of two formats:

"&hAARRGGBB" for a single colour. "&hAARRGGBB, &hAARRGGBB" for light colour, dark colour.

Optional spaces are permitted after the comma and flanking s.


Light(cg As ColorGroup) As Color

Returns the light colour component of cg.


ToString(cg As ColorGroup) As String

Returns a string representation of this color group in the format: &hAARRGGBB : &hAARRGGBB Where the left value is the light value and the right value is the dark value.


ToTOML(cg As ColorGroup) As String

Converts cg to a TOML value.

The resultant string will be in the format:

"&hAARRGGBB, &hAARRGGBB" representing light colour, dark colour.

This is the case even if only a single colour is specified (the light colour will be duplicated).