ColorScheme

Description

[ShutdownSurvive]
sealed class Tinman.Engine.GUI.Styles.ColorScheme

The ColorScheme provides methods and properties for computing various colors for rendering components.

A color scheme is defined by four colors: foreground, background, highlight and text color. All other colors are derived from those.

Public / Constants

Default


public static readonly attribute Default → (ColorScheme)

The default color scheme.

Public / Constructors

For

2 overloads


public static method For1 → (1)

component in : Component

[not-null]
The component from which to create a color scheme.

returns → ColorScheme

The color scheme.

Creates a new instance of ColorScheme from the style of the given component.

This method delegates to For2, passing the following stylesheet property values for the given component in:


public static method For2 → (4)

text in : int64

The text color.

foreground in : int64

The foreground color.

background in : int64

The background color.

highlight in : int64

The highlight color.

returns → ColorScheme

The color scheme.

Creates a new instance of ColorScheme.

Public / Methods

Draw​String


public static method DrawString → (8)

graphics in : Graphics

The graphics object to use.

font in : PixelFont

The font to use.

text in : string

The string to draw.

in : int32

X-coordinate of anchor point.

in : int32

Y-coordinate of anchor point.

textColor in : int64

The text color to use.

backgroundColor in : int64

The background color to use.

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

Draws an outlined string.

The outline color will be determined with Outline, passing textColor in and backgroundColor in.

Draw​Symbol

2 overloads


public static method DrawSymbol1 → (6)

graphics in : Graphics

The graphics object to use.

bitmap in : Bitmap

The symbol to draw.

in : Vec2I

The coordinates of the anchor point.

textColor in : int64

The color to use.

backgroundColor in : int64

The background color to use.

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

Draws an outlined symbol.

The outline color will be determined with Outline, passing textColor in and backgroundColor in.


public static method DrawSymbol2 → (7)

graphics in : Graphics

The graphics object to use.

bitmap in : Bitmap

The symbol to draw.

in : int32

X-coordinate of anchor point.

in : int32

Y-coordinate of anchor point.

textColor in : int64

The color to use.

backgroundColor in : int64

The background color to use.

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

Draws an outlined symbol.

The outline color will be determined with Outline, passing textColor in and backgroundColor in.

Outline


[Pure]
public static method Outline → (2)

textColor in : int64

The text color.

backgroundColor in : int64

The background color.

returns → int64

The outline color or 0 if no outline is necessary.

Computes the outline color that should be used to render text.

Public / Attributes

Background


public readonly attribute Background → (int64)

The background color.

Background​Light


public readonly attribute BackgroundLight → (int64)

A lighter variant of Background.

Border​Edge


public readonly attribute BorderEdge → (int64)

Color for drawing regular border edges.

Border​Edge​Dark


public readonly attribute BorderEdgeDark → (int64)

Color for drawing high contract border edges.

Border​Fill


public readonly attribute BorderFill → (int64)

The color to use for filling the interior of thick borders.

Border​Fill​Light


public readonly attribute BorderFillLight → (int64)

A lighter variant of BorderFill.

Foreground


public readonly attribute Foreground → (int64)

The foreground color.

Foreground​Contrast


public readonly attribute ForegroundContrast → (int64)

A lighter variant of Foreground with high contrast to Background.

Highlight


public readonly attribute Highlight → (int64)

The highlight color.

Highlight​Contrast


public readonly attribute HighlightContrast → (int64)

A lighter variant of Highlight with high contrast to Background.

Text


public readonly attribute Text → (int64)

The text color.

See also

Style.TextColor

Text​Faint


public readonly attribute TextFaint → (int64)

A variant of Text that has low contrast to Background.

Text​Faint​Light


public readonly attribute TextFaintLight → (int64)

A variant of Text that has low contrast to BackgroundLight.