Skip to content

Colorization

Namespace Nfty.Core.Model in assembly Nfty.Ticket.

public record Colorization

How a Dynamic or Static layer is colored.

Constructors

Colorization(ColorModel, int, int, IReadOnlyList<ColorEntry>)

public Colorization(ColorModel Model, int HueQuantize, int SatQuantize, IReadOnlyList<ColorEntry> Entries);

Parameters

  • Model (ColorModel) - The color space the entries are expressed in.
  • HueQuantize (int) - Hue bucket width in degrees, used when hashing the DNA. Quantizing is what folds a continuous color space into something countable, so two assets whose hues fall in one bucket are the same asset.
  • SatQuantize (int) - Saturation bucket width in percentage points, likewise.
  • Entries (IReadOnlyList<ColorEntry>) - The weighted color options. A Static layer has exactly one, fixed.

Properties

Entries

public IReadOnlyList<ColorEntry> Entries { get; init; }

The weighted color options. A Static layer has exactly one, fixed.

HueQuantize

public int HueQuantize { get; init; }

Hue bucket width in degrees, used when hashing the DNA. Quantizing is what folds a continuous color space into something countable, so two assets whose hues fall in one bucket are the same asset.

Model

public ColorModel Model { get; init; }

The color space the entries are expressed in.

SatQuantize

public int SatQuantize { get; init; }

Saturation bucket width in percentage points, likewise.

Methods

Starter(LayerKind, ColorModel, ColorRange, string)

public static Colorization? Starter(LayerKind kind, ColorModel model, ColorRange range, string fixedSpec);

The colorization a new layer of kind starts with: one ranged entry for Dynamic, one fixed entry for Static, none for Custom (composited as-is).

Parameters

  • kind (LayerKind) - The layer's kind.
  • model (ColorModel) - The color space.
  • range (ColorRange) - The band a Dynamic layer rolls within.
  • fixedSpec (string) - The prefixed color a Static layer applies.

Returns. The colorization, or null for a Custom layer.