Skip to content

Brush<TPixel>

Namespace Nfty.Core.Editing in assembly Nfty.Core.

public readonly struct Brush<TPixel> : IEquatable<Brush<TPixel>>

Brush settings: stamp diameter in pixels and the pixel it paints. One type for both surfaces — a gray brush is a Brush<GrayPixel>, a color brush a Brush<Rgba32> — because nothing about a brush differs between them beyond its payload. The payload carries its own alpha, which is what lets an unlocked session paint a semi-transparent stroke; under OpacityLock.Locked it is snapped when applied.

Type parameters

  • TPixel - The pixel the target surface stores.

Constructors

Brush(int, TPixel)

public Brush(int Size, TPixel Pixel);

Parameters

  • Size (int) - Stamp diameter in pixels.
  • Pixel (TPixel) - What the brush paints.

Type parameters

  • TPixel - The pixel the target surface stores.

Properties

Pixel

public TPixel Pixel { get; init; }

What the brush paints.

Size

public int Size { get; init; }

Stamp diameter in pixels.