Modifier.Foreground

Modifier
public sealed class Modifier.Foreground : Modifier
Produces a foreground colour that reads against the incoming colour: white for dark colours, black for light ones, moved by the given percentage. At 100% the result is pure black or white.

Constructors

Foreground

#
public Foreground(
percent
)

Fields

DarkThreshold

#
Lightness below which a colour counts as dark and gets a light foreground. For neutral colours this agrees with the hand-tuned rule in ColourExtensionMethods.IsDarkBackground, which flips around 60% grey.
public const double DarkThreshold = 0.68

Properties

Dependencies

Gets the properties this modifier reads besides the value it modifies. Most modifiers read none; a mix towards another property reads that one.
public virtual PropertyId[] Dependencies { get; }
inherited fromModifier

Kind

#
public override PropertyType Kind { get; }
Modifier.Kind

Percent

#
public int Percent { get; }

Methods

Apply

#
public override SkinValue Apply()
Modifier.Apply

ToString

public override string ToString()
inherited fromModifier
Object.ToString

ToText

#
public override string ToText()
Modifier.ToText

WithoutReferences

A copy of this modifier with every property reference replaced by the colour it resolves to right now, so the modifier can be applied without a definition at hand. Modifiers without references return themselves.
public virtual Modifier WithoutReferences()
inherited fromModifier