Used to map colour name to colour value. Note that this can be deleted - make sure you add a compile flag of "NoColourMap" if you choose to remove it to minimise size.
Static Public Member Functions | |
static Color | ToSpecialColour (string randomString) |
Converts any random string into a colour. This is a strange part of the specs that rarely gets used now, but it makes for some interesting colours ("grass" is green!). For example, body bgcolor uses this. More... | |
static Color | GetColourByName (string name, out bool success) |
Maps colour name, e.g. aqua, to colour. Must be lowercase. More... | |
static Color | GetColour (string valueText) |
Gets a colour from either hex or a named colour. More... | |
static Color | GetHexColour (string valueText) |
Gets a colour from a hex HTML string. More... | |
static void | GetHexColour (string valueText, out float r, out float g, out float b, out float a) |
Gets a colour from a hex HTML string. More... | |
static void | GetHexColour (string valueText, out int r, out int g, out int b, out int a) |
Gets a colour from a hex HTML string. More... | |
Static Private Member Functions | |
static int | LoadHexFromPart (string randomString, int startOffset, int length) |
Loads a hex value from the given 'any' string. Non-hex chars are treated as 0. (Normally, non-hex chars invalidate the whole thing). More... | |
static int | DoubleNibble (int nibble) |
Duplicates the given nibble (4 bit number) and places the result alongside in the same byte. E.g. c in hex becomes cc. More... | |
Static Private Attributes | |
static Dictionary< string, Color > | Map |
A map from colour name to hex value. More... | |
static string[] | Colours |
|
inlinestaticprivate |
Duplicates the given nibble (4 bit number) and places the result alongside in the same byte. E.g. c in hex becomes cc.
nibble | The nibble to duplicate. |
|
inlinestatic |
Gets a colour from either hex or a named colour.
|
inlinestatic |
Maps colour name, e.g. aqua, to colour. Must be lowercase.
|
inlinestatic |
Gets a colour from a hex HTML string.
|
inlinestatic |
Gets a colour from a hex HTML string.
|
inlinestatic |
Gets a colour from a hex HTML string.
|
inlinestaticprivate |
Loads a hex value from the given 'any' string. Non-hex chars are treated as 0. (Normally, non-hex chars invalidate the whole thing).
|
inlinestatic |
Converts any random string into a colour. This is a strange part of the specs that rarely gets used now, but it makes for some interesting colours ("grass" is green!). For example, body bgcolor uses this.
|
staticprivate |
|
staticprivate |
A map from colour name to hex value.