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

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

IconsSkin

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

Fields

Default

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

Properties

ColourFilter

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

Filter

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

HasFilter

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

Palette

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

Methods

Explicit

IStorable.Store

#
void IStorable.Store(IWriter writer)
writer (IWriter)
Store

Interpolate

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

Process

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

WithFilter

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

WithPalette

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