Struct InkAppearance
How an ink looks at full tint where it cannot be printed: on an RGB canvas, in SVG, in a proof of a raster without its plate, or drawn into the process inks of a raster that lacks it. A process CMYK colour, an sRGB colour or a Lab colour, as PDF's alternate colour spaces allow.
public readonly struct InkAppearance : IEquatable<InkAppearance>
- Implements
- Inherited Members
Examples
// The inks of a page: FOGRA39's process inks, a spot colour with how it looks, and a varnish that never shows.
InkSet inks = InkSet.FromProfile(ColorProfile.Fogra39)
.WithSpot("PANTONE 186 C", InkAppearance.Cmyk(0, 1, 0.81f, 0.04f))
.WithSpot("Varnish", null, ColorantKind.Technical);
// Colours as inks: process CMYK, the spot at 60%, and the spot over 30% black (a DeviceN colour).
InkColor text = InkColor.Cmyk(0, 0, 0, 1);
InkColor logo = InkColor.Spot(inks[4], 0.6f);
InkColor shadow = InkColor.Mix(new InkTint(Colorant.Black, 0.3f), new InkTint(inks[4], 1));
InkAppearance? onScreen = shadow.Appearance; // CMYK 0, 1, 0.81, 0.328: the spot's look printed over the black
Properties
Kind
Gets the colour model.
public InkAppearanceKind Kind { get; }
Property Value
Values
Gets the values: cyan, magenta, yellow and black 0 to 1 for Cmyk; red, green and blue 0 to 1 and 0 for Rgb; L, a, b and 0 for Lab.
public Vector4 Values { get; }
Property Value
Methods
Cmyk(float, float, float, float)
Returns a process CMYK appearance.
public static InkAppearance Cmyk(float c, float m, float y, float k)
Parameters
Returns
- InkAppearance
The appearance.
Exceptions
- ArgumentOutOfRangeException
A value is outside 0 to 1.
Equals(InkAppearance)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(InkAppearance other)
Parameters
otherInkAppearanceAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Lab(LabColor)
Returns a Lab appearance (D50, as ICC's PCS and PDF's Lab colours).
public static InkAppearance Lab(LabColor lab)
Parameters
labLabColorThe colour: L 0 to 100.
Returns
- InkAppearance
The appearance.
Exceptions
- ArgumentOutOfRangeException
L is outside 0 to 100, or a or b is not finite.
Rgb(float, float, float)
Returns an sRGB appearance.
public static InkAppearance Rgb(float r, float g, float b)
Parameters
Returns
- InkAppearance
The appearance.
Exceptions
- ArgumentOutOfRangeException
A value is outside 0 to 1.
ToLab()
Returns the appearance as Lab: a CMYK appearance through FOGRA39 (relative colorimetric), an RGB one as sRGB.
public LabColor ToLab()
Returns
- LabColor
The colour.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(InkAppearance, InkAppearance)
Returns whether two appearances have the same model and values.
public static bool operator ==(InkAppearance left, InkAppearance right)
Parameters
leftInkAppearanceThe first.
rightInkAppearanceThe second.
Returns
operator !=(InkAppearance, InkAppearance)
Returns whether two appearances differ in model or values.
public static bool operator !=(InkAppearance left, InkAppearance right)
Parameters
leftInkAppearanceThe first.
rightInkAppearanceThe second.