IconsSkin

References
public sealed class IconsSkin : IStorable
The icon part of a skin: the palette icons are drawn with, and the filter every icon colour passes through on its way to the screen. The filter is a stack of colour modifiers; by the time it arrives here any property references in it have been resolved, so it can run without a definition at hand. Results are memoised per input colour, since icons reuse a small set of colours many times per frame.

Constructors

IconsSkin

#
Create a new icons skin.
public IconsSkin(
palette,
Palette to draw icons with.
filter
Modifiers applied to every icon colour, in order. Null or empty for no filter.
)

IconsSkin

#
Deserialization constructor.
public IconsSkin(
reader
Reader object.
)

Fields

Default

#
The built-in icon styling: the standard Grasshopper palette and no filter.
public static readonly IconsSkin Default

Properties

ColourFilter

#
Gets the filter as a function, in the form icon drawing consumes it, or null when there is no filter.
public Func<Color, Color> ColourFilter { get; }

Filter

#
Gets the modifiers every icon colour passes through, in order. Empty when there is no filter.
public Modifier[] Filter { get; }

HasFilter

#
Gets whether any modifiers are applied to icon colours.
public bool HasFilter { get; }

Palette

#
Gets the palette icons are drawn with.
public IconPalette Palette { get; }

Methods

Explicit

IStorable.Store

#
void IStorable.Store(
writer
)
Store

Interpolate

#
Interpolate between two icon skins. Palette colours blend; the filter switches half way.
public IconsSkin Interpolate(
other,
factor
)

Process

#
Run a colour through the filter. This never throws; a filter that cannot be applied leaves colours as they are and is logged once.
public Color Process(
Color
colour
)

WithFilter

#
Replace the filter of this skin.
public IconsSkin WithFilter(
filter
)

WithPalette

#
Replace the palette of this skin.
public IconsSkin WithPalette(
palette
)