NamedColour

References
public sealed class NamedColour : IStorable
A (mostly) immutable named colour.

Constructors

NamedColour

#
Deserialization constructor
public NamedColour(
reader
)

NamedColour

#
Create a new linguistic colour.
public NamedColour(
name,
Name of colour.
Color
colour,
Colour.
alternates = null,
Optional alternate spellings.
adjectives = null,
Optional adjectives.
importance = ColourImportance.Primary,
Importance.
source = null,
Source.
footnote = null
Footnote.
)

NamedColour

#
Create a new linguistic colour entity.
public NamedColour(
names,
Names of colour (comma separated). First entry is the official name.
adjectives,
Optional adjectives of colour (comma separated).
Color
colour,
Colour. Alpha channel values are ignored.
importance = ColourImportance.Primary,
Linguistic importance.
source = null,
Optional entity source. For example name of standard.
footnote = null
Optional footnote.
)

Properties

Adjectives

#
Gets the adjective associated with this entity. I.e. "reddish", or "blackish".
public IEnumerable<string> Adjectives { get; }

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").
public IEnumerable<string> Alternates { get; }

Colour

#
Gets the colour associated with this entity.
public Color Colour { get; }

Footnote

#
Gets the author comments associated with this entity.
public string Footnote { get; }

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.
public ColourImportance Importance { get; set; }

Name

#
Gets the name associated with this entity.
public string Name { get; }

Source

#
Gets the category under which this entity is grouped.
public string Source { get; }

Timestamp

#
Gets the timestamp for when this colour was created.
public DateTime Timestamp { get; }

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.
public static NamedColour FromString(
line
Line to parse.
)
Linguistic colour.

Store

#
This method is called whenever the instance is required to serialize itself.
public void Store(
writer
Writer object to serialize with.
)
Store

ToAdjectivesString

#
Create a name string including all alternate spellings.
public string ToAdjectivesString()

ToNamesString

#
Create a name string including all alternate spellings.
public string ToNamesString()

ToString

#
Returns a string that represents the current object.
public override string ToString()
A string that represents the current object.
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.
public static NamedColour TryMerge(
params NamedColour[]
colours
Colours to merge.
)
Lossless combination.