Modifier

References
public abstract class Modifier
A step applied to an inherited value on its way from the source property to the property that inherits it. Colour modifiers work in Oklab, so equal amounts look like equal changes. Amounts are integer percentages (or whole degrees for hue), which is as fine as the UI needs. The set of modifiers is closed; the nested types are all there are.

Properties

Dependencies

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

Kind

#
public abstract PropertyType Kind { get; }

Methods

Apply

#
public abstract SkinValue Apply(SkinValue value, Func<PropertyId, SkinValue> resolve)
value (SkinValue)
resolve (Func<PropertyId, SkinValue>)

ToString

#
public override string ToString()
Object.ToString

ToText

#
public abstract string ToText()
Write this modifier the way it appears in a skin definition file, for example "Luminance -20%".

TryParse

#
public static bool TryParse(string text, out Modifier modifier, out string error)
Parse a modifier from its text form.
text (string)Text such as "Luminance -20%", "Hue +30°", "Mix #C0EB75 80%" or "Scale 150%".
modifier (out Modifier)Parsed modifier.
error (out string)Reason for failure, or null.

WithoutReferences

#
public virtual Modifier WithoutReferences(Func<PropertyId, SkinValue> resolve)
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.
resolve (Func<PropertyId, SkinValue>)