Grasshopper2.UI.Skinningnamespace
Types
Grasshopper2.UI.Skinning.Binding
The assignment of a skin property. Either set outright, or inherited from another property through zero or more modifiers.
Grasshopper2.UI.Skinning.CanvasSkin
Immutable collection of canvas skin settings.
Grasshopper2.UI.Skinning.ColourOperand
Either a literal colour or a reference to a colour property; the second operand of a mix.
Grasshopper2.UI.Skinning.EdgeDescription
Immutable skin descriptor for edges (aka pens).
Grasshopper2.UI.Skinning.Fades
A collection of related zoom-linked fading states. These typically are assigned from scratch for each drawing operation, and are thus not specified as a user setting.
Grasshopper2.UI.Skinning.FillDescription
Immutable skin descriptor for brushes.
Grasshopper2.UI.Skinning.GridSkin
A collection of visual properties for canvas grids.
Grasshopper2.UI.Skinning.IconsSkin
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.
Grasshopper2.UI.Skinning.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.
Grasshopper2.UI.Skinning.Modifier.Contrast
Stretches lightness away from mid-grey, or squeezes it towards mid-grey for negative percentages. Light colours get lighter and dark ones darker, so the order of a set of shades is kept; at -100% every colour has the same lightness. Chroma is left alone, that is what Modifier.Saturation is for.
Grasshopper2.UI.Skinning.Modifier.CopyHue
Keeps the lightness and chroma of a colour but takes its hue from another colour. A neutral source has no hue to give, so it leaves the colour alone.
Grasshopper2.UI.Skinning.Modifier.Foreground
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.
Grasshopper2.UI.Skinning.Modifier.Hue
Rotates the hue of a colour by a whole number of degrees.
Grasshopper2.UI.Skinning.Modifier.Luminance
Lightens or darkens a colour. Negative percentages move the Oklab lightness towards black by that fraction, positive ones move it towards white.
Grasshopper2.UI.Skinning.Modifier.Mix
Mixes a colour towards another colour, in Oklab, by a percentage.
Grasshopper2.UI.Skinning.Modifier.Offset
Adds a number of canvas pixels, which may be fractional. Results never drop below zero.
Grasshopper2.UI.Skinning.Modifier.Opacity
Sets the opacity of a colour outright.
Grasshopper2.UI.Skinning.Modifier.Saturation
Scales the chroma of a colour. -100% makes it neutral, +50% makes it half again as saturated.
Grasshopper2.UI.Skinning.Modifier.Scale
Multiplies a number by a percentage; 150% makes it half again as large.
Grasshopper2.UI.Skinning.PropertyId
Identifies a single property of a skin. An identifier is composed of one mode bit, one family bit, one role bit and zero or more variant bits, so the selected, hidden and disabled versions of a property share a role rather than being duplicated. Not every combination exists; the set of real properties is enumerated by SkinProperties.All, and each role below says which families use it.
Grasshopper2.UI.Skinning.PropertyType
The kind of value a skin property holds.
Grasshopper2.UI.Skinning.ShadeKind
Enumerates the types of defined shading schemes.
Grasshopper2.UI.Skinning.Skin
Represents a collection of immutable UI skinning settings.
Grasshopper2.UI.Skinning.SkinDefinition
The editable source of a Skin. Every property of the skin is either set outright, inherited from another property through modifiers, or left unbound and taken from the built-in default. The Lit and Dim skins live in one definition and may inherit from each other; an unbound icon property does so on its own, following its twin in the other mode before it resorts to the built-in default. A definition compiles to a Skin with SkinDefinition.ToSkin(PropertyId).
Grasshopper2.UI.Skinning.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.Grasshopper2.UI.Skinning.SkinEditorCanvas
The skin editor's canvas: specimen capsules and wires drawn from the primitives with the skin a definition compiles to, under a layer of widgets that sit on the properties they control. Drawn straight to the control every frame, like the real canvas.
Grasshopper2.UI.Skinning.SkinEditorForm
The window that hosts the skin editor canvas. One instance at a time. It edits one stored skin, named by the text box in the bar; Save writes it to the skins folder and, if the canvas uses that skin, re-applies it at once.
Grasshopper2.UI.Skinning.SkinProperties
Static knowledge about skin properties: which combinations of PropertyId bits exist, what kind of value each holds, and how identifiers are written as text.
Grasshopper2.UI.Skinning.SkinPropertyText
Human wording for skin properties: a short title such as "Normal Edge" and a sentence saying what the property affects. Tokens are for files; these are for people.
Grasshopper2.UI.Skinning.SkinServer
The skins folder and everything that touches it. A skin is a text definition in Folders.SkinsFolder, and its name is its file name; the canvas picks a skin by that name through Settings.CanvasSkin, with an empty name meaning the built-in default. Files may be imported from and exported to anywhere. The skins shipped with Grasshopper, other than the default, are copied into the folder the first time it is used, and from then on are files like any other.
Grasshopper2.UI.Skinning.SkinValue
The value of a skin property: a colour, a number, a filter or a dash pattern, never more than one.
Grasshopper2.UI.Skinning.WireColours
The colours of one wire group. The glow behind selected wires is shared by every group and lives on WiresSkin.
Grasshopper2.UI.Skinning.WireEdges
The strokes of one kind of wire: the outer stroke and an optional lighter core.
Grasshopper2.UI.Skinning.WireGroup
The groups of wires that share colours. Item, list and tree wires all carry data and look alike; only empty, disabled and tentative wires may deviate.
Grasshopper2.UI.Skinning.WireSkin
The look of one kind of wire: colours and strokes. Colours are shared between kinds by WiresSkin; this is the resolved view for a single kind.
Grasshopper2.UI.Skinning.WiresSkin