SkinDefinitionText
The text form of a skin definition. One property per line:
// comment
Lit.Shades.Apex.Normal = #E2E2E2
Lit.Shades.Slab.Normal = Lit.Shades.Apex.Normal | Luminance -20%
Lit.Shape.Corners = 3
Lit.Icons.Filter = Saturation -70% | Mix Lit.Canvas.Paper 10%
Lit.Wires.Dash.Null = 4 1 Colour literals use CSS notation: hex, oklch(), oklab() or rgb(), with an optional alpha after a slash. A filter is a bare stack of colour modifiers, or None. A dash pattern is dash and gap lengths in multiples of the wire width, or Solid. Everything else is this format's own.Fields
Methods
Parse
#Parse definition text into an existing definition. Lines that cannot be read are reported and skipped; the rest are applied.
Parameters:
| text (string) | Definition text. |
| definition (SkinDefinition) | Definition to add bindings to. |
| errors (List<string>) | Receives one message per faulty line, with its line number. |
Returns: True if every line was read.
TryParseBinding
#public static bool TryParseBinding(string text, PropertyType kind, out Binding binding, out string error)
Parameters:
| text (string) | |
| kind (PropertyType) | |
| binding (out Binding) | |
| error (out string) |
TryParseColour
#Parse a colour literal in CSS notation: #RGB, #RRGGBB, #RRGGBBAA, oklch(L C H), oklab(L a b) or rgb(r g b), each optionally followed by "/ alpha" where alpha is a fraction or a percentage.
TryParseFilter
#Parse a filter: colour modifiers separated by pipes, or NoFilter.
Parameters:
| text (string) | |
| filter (out Modifier[]) | |
| error (out string) |
WriteColour
#Write a colour literal. Colours defined in Oklab become oklch(); everything else becomes hex, rounded to the 8-bit grid. rgb() is still read, never written.
Parameters:
| colour (Colour) |
WriteDash
#Write a dash pattern as its lengths separated by spaces, or SolidDash when there are none.
Parameters:
| dash (float[]) |
WriteFilter
#Write a filter as its modifiers separated by pipes, or NoFilter when there are none.
Parameters:
| filter (Modifier[]) |