Constructors
NamedColour
#public NamedColour(string name, Color colour, IEnumerable<string> alternates = null, IEnumerable<string> adjectives = null, ColourImportance importance = ColourImportance.Primary, string source = null, string footnote = null)
Create a new linguistic colour.
Parameters:
| name (string) | Name of colour. |
| colour (Color) | Colour. |
| alternates (IEnumerable<string> = null) | Optional alternate spellings. |
| adjectives (IEnumerable<string> = null) | Optional adjectives. |
| importance (ColourImportance = ColourImportance.Primary) | Importance. |
| source (string = null) | Source. |
| footnote (string = null) | Footnote. |
NamedColour
#public NamedColour(string names, string adjectives, Color colour, ColourImportance importance = ColourImportance.Primary, string source = null, string footnote = null)
Create a new linguistic colour entity.
Parameters:
| names (string) | Names of colour (comma separated). First entry is the official name. |
| adjectives (string) | Optional adjectives of colour (comma separated). |
| colour (Color) | Colour. Alpha channel values are ignored. |
| importance (ColourImportance = ColourImportance.Primary) | Linguistic importance. |
| source (string = null) | Optional entity source. For example name of standard. |
| footnote (string = null) | Optional footnote. |
Properties
Alternates
#Gets all the different spellings associated with this colour. The first spelling is identical to the 'official' name, subsequent entries are considered alternate spellings (i.e. "grey" and "gray").
Importance
#Gets or sets the linguistic importance of this colour. This is the only mutable property of this type, a pattern forced upon me by the Eto controls.
Methods
FromString
#Parse a string as a linguistic colour entity. The format must be the same as the result of the ToString() method. This method throws exceptions if the format is not valid.
Parameters:
| line (string) | Line to parse. |
Returns: Linguistic colour.
ToString
#Returns a string that represents the current object.
Returns: A string that represents the current object.
Overrides: Object.ToString
TryMerge
#Attempt to losslessly merge two colours. For two colours to be mergeable they must have the same name and the exact same colour. Alternate names, adjectives, sources and footnotes will be combined.
Parameters:
| colours (params NamedColour[]) | Colours to merge. |
Returns: Lossless combination.