Skip to content

StackPick

Namespace Nfty.Model in assembly Nfty.Model.

public readonly struct StackPick : IEquatable<StackPick>

One present layer of a selection: its ingredient, the variant chosen, and the color it rolled (null for the stored pixels).

Constructors

StackPick(string, string, RolledColor?)

public StackPick(string IngredientId, string VariantId, RolledColor? Color = null);

Parameters

  • IngredientId (string) - The layer's ingredient id.
  • VariantId (string) - The chosen variant id.
  • Color (RolledColor?) - The rolled hue and saturation, or null to use the stored pixels.

Properties

Color

public RolledColor? Color { get; init; }

The rolled hue and saturation, or null to use the stored pixels.

IngredientId

public string IngredientId { get; init; }

The layer's ingredient id.

VariantId

public string VariantId { get; init; }

The chosen variant id.

Methods

WithColors(IReadOnlyList<(string, string)>, IReadOnlyList<LayerColor>)

public static IReadOnlyList<StackPick> WithColors(IReadOnlyList<(string, string)> present, IReadOnlyList<LayerColor> colors);

Attaches recorded colors to a selection.

Parameters

  • present (IReadOnlyList<(string, string)>) - The present layers in paint order.
  • colors (IReadOnlyList<LayerColor>) - Recorded per-layer colors; LayerColor.Layer is the ingredient id.

Returns. The picks; a color is set only when both H and S were recorded. The unrounded LayerColor.ExactH/LayerColor.ExactS win, so the model is the cook's own to the bit. A Set cooked before they existed has only the rounded H (0.1 degree) and S (0.001): that fallback is within 1 LSB of an 8-bit channel, not byte-identical.

Operators

op_Implicit((string, string))

public static implicit operator StackPick((string, string) t);

A pick with no color from an (ingredient, variant) pair.

Parameters

  • t ((string, string)) - The pair.

Returns. The pick.