Skip to content

XUIColorGroups

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
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.


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).