Show / Hide Table of Contents

Class NamedColorUtils

Static utility methods for working with dye colors

Inheritance
System.Object
NamedColorUtils
Namespace: Eco.Shared.Graphics
Assembly: Eco.Shared.dll
Syntax
public static class NamedColorUtils : Object

Fields

AllColors

Contains all generated named colors based on basic ones and the result of NamedColorGenerator

Declaration
public static readonly List<NamedColor> AllColors
Field Value
Type Description
System.Collections.Generic.List<NamedColor>

BaseColors

Table mapping every NamedColors type to its RGB value for rendering.

Declaration
public static readonly Dictionary<NamedColors, ByteColor> BaseColors
Field Value
Type Description
System.Collections.Generic.Dictionary<NamedColors, ByteColor>

GroupedColors

Declaration
public static readonly Dictionary<NamedColor, List<NamedColor>> GroupedColors
Field Value
Type Description
System.Collections.Generic.Dictionary<NamedColor, System.Collections.Generic.List<NamedColor>>

Methods

GetBaseColors()

Returns all base named colors

Declaration
public static List<ByteColor> GetBaseColors()
Returns
Type Description
System.Collections.Generic.List<ByteColor>

GetClosestColorName(ByteColor)

Gets closest name of a color.

Declaration
public static LocString GetClosestColorName(ByteColor color)
Parameters
Type Name Description
ByteColor color
Returns
Type Description
LocString

GetClosestNamedColor(ByteColor)

Returns the closest NamedColors to a given Color

Declaration
public static NamedColor GetClosestNamedColor(ByteColor requestedColor)
Parameters
Type Name Description
ByteColor requestedColor
Returns
Type Description
NamedColor

GetNamedColor(NamedColors)

Returns a ByteColor instance matching the RGB value of a NamedColors dye type.

Declaration
public static ByteColor GetNamedColor(this NamedColors namedColor)
Parameters
Type Name Description
NamedColors namedColor
Returns
Type Description
ByteColor

GetRandomNamedColor()

Returns a random NamedColors from the available in "BASE" table.

Declaration
public static NamedColors GetRandomNamedColor()
Returns
Type Description
NamedColors

GetRandomNamedColorAll()

Returns a random NamedColors from the available in "BLENDED" table.

Declaration
public static NamedColor GetRandomNamedColorAll()
Returns
Type Description
NamedColor
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾