Class SolidPaint
One color everywhere, with straight alpha. The color keeps float precision, so float and 16-bit targets get it in full; values outside 0 to 1 are kept on the paint, and the blend clamps them as Egami's Compositor does.
public sealed record SolidPaint : Paint, ITextPaint, IEquatable<Paint>, IEquatable<SolidPaint>
- Inheritance
-
SolidPaint
- Implements
- Inherited Members
Examples
// A color converts to a SolidPaint. A paint also carries a blend mode, an opacity and whether edges are antialiased.
canvas.FillRect(new RectF(0, 0, 200, 100), Rgba8.White);
SolidPaint glaze = new(new RgbaF32(0.9f, 0.2f, 0.1f, 1)) { BlendMode = BlendMode.Multiply, Opacity = 0.6f };
canvas.FillCircle(new Vector2(60, 50), 40, glaze);
// Pixel art: no antialiasing, so every pixel is fully drawn or not at all.
canvas.FillCircle(new Vector2(150, 50), 30, new SolidPaint(Rgba8.Black) { Antialias = false });
Constructors
SolidPaint(InkColor)
Initializes a new instance of the SolidPaint class with a colour given as inks: an ink canvas prints its inks; every other canvas draws Color, its appearance in sRGB (transparent when it has none).
public SolidPaint(InkColor ink)
Parameters
inkInkColorThe inks and their tints.
Exceptions
- ArgumentNullException
inkis null.
SolidPaint(Rgba8)
Initializes a new instance of the SolidPaint class.
public SolidPaint(Rgba8 color)
Parameters
colorRgba8The color.
SolidPaint(RgbaF32)
Initializes a new instance of the SolidPaint class.
public SolidPaint(RgbaF32 color)
Parameters
colorRgbaF32The color.
Exceptions
- ArgumentException
A channel is not finite.
Properties
Color
Gets the color.
public RgbaF32 Color { get; init; }
Property Value
Exceptions
- ArgumentException
A channel is not finite.
Ink
Gets the colour as inks, or null for an RGB colour. Setting it sets Color to its appearance in sRGB. An ink canvas prints the inks; other canvases draw Color.
public InkColor? Ink { get; init; }
Property Value
Exceptions
- ArgumentNullException
The value is null.