Search Results for

    Show / Hide Table of Contents

    Class Color

    Color information class

    Inheritance
    object
    Color
    Namespace: Terminaux.Colors
    Assembly: Terminaux.dll
    Syntax
    [JsonConverter(typeof(ColorSerializer))]
    public class Color

    Constructors

    | Edit this page View Source

    Color(ConsoleColor)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(ConsoleColor ColorDef)
    Parameters
    Type Name Description
    ConsoleColor ColorDef

    The color taken from System.ConsoleColor

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(ConsoleColor, ColorSettings)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(ConsoleColor ColorDef, ColorSettings settings)
    Parameters
    Type Name Description
    ConsoleColor ColorDef

    The color taken from System.ConsoleColor

    ColorSettings settings

    Color settings to use while building the color

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(Color)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(Color color)
    Parameters
    Type Name Description
    Color color

    The color from Drawing

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(int)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(int ColorNum)
    Parameters
    Type Name Description
    int ColorNum

    The color number or a decimal number that specifies the RGB values up to 16777215

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(int, int, int)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(int R, int G, int B)
    Parameters
    Type Name Description
    int R

    The red level

    int G

    The green level

    int B

    The blue level

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(int, int, int, ColorSettings)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(int R, int G, int B, ColorSettings settings)
    Parameters
    Type Name Description
    int R

    The red level

    int G

    The green level

    int B

    The blue level

    ColorSettings settings

    Color settings to use while building the color

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(int, ColorSettings)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(int ColorNum, ColorSettings settings)
    Parameters
    Type Name Description
    int ColorNum

    The color number or a decimal number that specifies the RGB values up to 16777215

    ColorSettings settings

    Color settings to use while building the color

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(string)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(string ColorSpecifier)
    Parameters
    Type Name Description
    string ColorSpecifier

    A color specifier. It must be a valid number from 0-255 if using 255-colors, a VT sequence if using true color as follows: <R>;<G>;<B>, or a hexadecimal representation of a number (#AABBCC for example)

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(string, ColorSettings)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(string ColorSpecifier, ColorSettings settings)
    Parameters
    Type Name Description
    string ColorSpecifier

    A color specifier. It must be a valid number from 0-255 if using 255-colors, a VT sequence if using true color as follows: <R>;<G>;<B>, or a hexadecimal representation of a number (#AABBCC for example)

    ColorSettings settings

    Color settings to use while building the color

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(ConsoleColors)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(ConsoleColors ColorDef)
    Parameters
    Type Name Description
    ConsoleColors ColorDef

    The color taken from ConsoleColors

    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    Color(ConsoleColors, ColorSettings)

    Makes a new instance of color class from specifier.

    Declaration
    public Color(ConsoleColors ColorDef, ColorSettings settings)
    Parameters
    Type Name Description
    ConsoleColors ColorDef

    The color taken from ConsoleColors

    ColorSettings settings

    Color settings to use while building the color

    Exceptions
    Type Condition
    TerminauxException

    Properties

    | Edit this page View Source

    Brightness

    Determines the color brightness whether it indicates dark or light mode

    Declaration
    public ColorBrightness Brightness { get; }
    Property Value
    Type Description
    ColorBrightness
    | Edit this page View Source

    ColorEnum16

    The color value converted to System.ConsoleColor. Not applicable [-1] to non-4-bit colors.

    Declaration
    public ConsoleColor ColorEnum16 { get; }
    Property Value
    Type Description
    ConsoleColor
    | Edit this page View Source

    ColorEnum255

    The color value converted to ConsoleColors.

    Declaration
    public ConsoleColors ColorEnum255 { get; }
    Property Value
    Type Description
    ConsoleColors
    | Edit this page View Source

    ColorId

    The color ID for 256- and 16-color modes.

    Declaration
    public ConsoleColorData ColorId { get; }
    Property Value
    Type Description
    ConsoleColorData
    | Edit this page View Source

    Empty

    Empty color singleton

    Declaration
    public static Color Empty { get; }
    Property Value
    Type Description
    Color
    | Edit this page View Source

    Hex

    Hexadecimal representation of the color

    Declaration
    public string Hex { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Name

    Color name representation

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Opacity

    Color opacity from 0 (transparent) to 255 (opaque)

    Declaration
    public int Opacity { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    PlainSequence

    Either 0-255, or <R>;<G>;<B>, depending on the settings.

    Declaration
    public string PlainSequence { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    PlainSequenceOriginal

    Either 0-255, or <R>;<G>;<B> in its original form.

    Declaration
    public string PlainSequenceOriginal { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    PlainSequenceTrueColor

    <R>;<G>;<B>

    Declaration
    public string PlainSequenceTrueColor { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    RGB

    An instance of RGB

    Declaration
    public RedGreenBlue RGB { get; }
    Property Value
    Type Description
    RedGreenBlue
    | Edit this page View Source

    Type

    Color type

    Declaration
    public ColorType Type { get; }
    Property Value
    Type Description
    ColorType
    | Edit this page View Source

    VTSequenceBackground

    Parsable VT sequence (Background)

    Declaration
    public string VTSequenceBackground { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    VTSequenceBackgroundOriginal

    Parsable VT sequence (Background, original)

    Declaration
    public string VTSequenceBackgroundOriginal { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    VTSequenceBackgroundTrueColor

    Parsable VT sequence (Background, true color)

    Declaration
    public string VTSequenceBackgroundTrueColor { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    VTSequenceForeground

    Parsable VT sequence (Foreground)

    Declaration
    public string VTSequenceForeground { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    VTSequenceForegroundOriginal

    Parsable VT sequence (Foreground, original)

    Declaration
    public string VTSequenceForegroundOriginal { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    VTSequenceForegroundTrueColor

    Parsable VT sequence (Foreground, true color)

    Declaration
    public string VTSequenceForegroundTrueColor { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    Equals(Color)

    Checks to see if this instance of the color is equal to another instance of the color

    Declaration
    public bool Equals(Color other)
    Parameters
    Type Name Description
    Color other

    Another instance of the color to compare with this color

    Returns
    Type Description
    bool

    True if both the colors match; otherwise, false.

    | Edit this page View Source

    Equals(Color, Color)

    Checks to see if the first instance of the color is equal to another instance of the color

    Declaration
    public bool Equals(Color other, Color other2)
    Parameters
    Type Name Description
    Color other

    Another instance of the color to compare with another

    Color other2

    Another instance of the color to compare with another

    Returns
    Type Description
    bool

    True if both the colors match; otherwise, false.

    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    ToString()

    Either 0-255, or <R>;<G>;<B>, depending on the usage of the terminal palette.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    | Edit this page View Source

    operator ==(Color, Color)

    Declaration
    public static bool operator ==(Color a, Color b)
    Parameters
    Type Name Description
    Color a
    Color b
    Returns
    Type Description
    bool
    | Edit this page View Source

    implicit operator Color(ConsoleColor)

    Makes a new instance of color class from specifier.

    Declaration
    public static implicit operator Color(ConsoleColor ColorDef)
    Parameters
    Type Name Description
    ConsoleColor ColorDef

    The color taken from System.ConsoleColor

    Returns
    Type Description
    Color
    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    implicit operator Color(Color)

    Makes a new instance of color class from specifier.

    Declaration
    public static implicit operator Color(Color color)
    Parameters
    Type Name Description
    Color color

    The color from Drawing

    Returns
    Type Description
    Color
    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    implicit operator Color(int)

    Makes a new instance of color class from specifier.

    Declaration
    public static implicit operator Color(int ColorNum)
    Parameters
    Type Name Description
    int ColorNum

    The color number

    Returns
    Type Description
    Color
    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    implicit operator Color(string)

    Makes a new instance of color class from specifier.

    Declaration
    public static implicit operator Color(string ColorSpecifier)
    Parameters
    Type Name Description
    string ColorSpecifier

    A color specifier. It must be a valid number from 0-255 if using 255-colors, a VT sequence if using true color as follows: <R>;<G>;<B>, or a hexadecimal representation of a number (#AABBCC for example)

    Returns
    Type Description
    Color
    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    implicit operator Color(ConsoleColors)

    Makes a new instance of color class from specifier.

    Declaration
    public static implicit operator Color(ConsoleColors ColorDef)
    Parameters
    Type Name Description
    ConsoleColors ColorDef

    The color taken from ConsoleColors

    Returns
    Type Description
    Color
    Exceptions
    Type Condition
    TerminauxException
    | Edit this page View Source

    operator !=(Color, Color)

    Declaration
    public static bool operator !=(Color a, Color b)
    Parameters
    Type Name Description
    Color a
    Color b
    Returns
    Type Description
    bool

    Extension Methods

    ColorContrast.GetContrastColorHalf(Color)
    ColorContrast.GetContrastColorNtsc(Color)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX