Table of Contents

Struct Ink

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

A colour as print thinks of it: an RGB colour, a CMYK process colour, or a named spot ink with a process-colour fallback — at some tint and opacity (docs/adr/0004-ink-colour-model.md).

public readonly struct Ink : IEquatable<Ink>
Implements
Inherited Members

Remarks

Components are fractions from 0 to 1. A tint is a percentage of an ink, as a press lays down less of it: a tint of an RGB colour moves it toward white paper, a tint of a process colour scales each component, and a tint of a spot ink is recorded as the tint the plate prints at. Opacity is separate, and describes how much of what lies beneath shows through.

Properties

Black

Black ink alone: what black text and rules should print with.

public static Ink Black { get; }

Property Value

Ink

FallbackModel

For a spot ink, the model its fallback is specified in; otherwise the ink's own model.

public InkModel FallbackModel { get; }

Property Value

InkModel

IsTransparent

public bool IsTransparent { get; }

Property Value

bool

Model

public InkModel Model { get; }

Property Value

InkModel

Opacity

From 0, invisible, to 1, fully covering what lies beneath.

public float Opacity { get; }

Property Value

float

Registration

Prints on every separation, for crop and registration marks.

public static Ink Registration { get; }

Property Value

Ink

SpotName

The spot ink's name, or null for a process colour.

public string? SpotName { get; }

Property Value

string

SpotTint

For a spot ink, the tint its plate prints at, from 0 to 1; otherwise 1.

public float SpotTint { get; }

Property Value

float

Transparent

Nothing is drawn.

public static Ink Transparent { get; }

Property Value

Ink

White

No ink at all: the paper shows.

public static Ink White { get; }

Property Value

Ink

Methods

Cmyk(float, float, float, float)

public static Ink Cmyk(float cyan, float magenta, float yellow, float black)

Parameters

cyan float
magenta float
yellow float
black float

Returns

Ink

Equals(Ink)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Ink other)

Parameters

other Ink

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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.

Hex(string)

Parses #RGB, #ARGB, #RRGGBB or #AARRGGBB as an RGB ink. The leading hash is optional; an alpha channel becomes the ink's opacity.

public static Ink Hex(string hex)

Parameters

hex string

Returns

Ink

Rgb(byte, byte, byte)

public static Ink Rgb(byte red, byte green, byte blue)

Parameters

red byte
green byte
blue byte

Returns

Ink

Spot(string, Ink)

A named spot ink. The fallback is what devices that cannot print the spot ink use instead.

public static Ink Spot(string name, Ink fallback)

Parameters

name string
fallback Ink

Returns

Ink

Tint(float)

A percentage of this ink, from 0 (none: bare paper) to 1 (the ink itself).

public Ink Tint(float amount)

Parameters

amount float

Returns

Ink

ToCmyk()

The colour as cyan, magenta, yellow and black fractions. RGB converts without a colour profile, with black generated from the darkest channel; a spot ink gives its fallback at the spot ink's tint.

public (float Cyan, float Magenta, float Yellow, float Black) ToCmyk()

Returns

(float Cyan, float Magenta, float Yellow, float Black)

ToRgb()

The colour as red, green and blue fractions, for output that can only show RGB. Process colours convert without a colour profile; a spot ink shows its fallback at the spot ink's tint.

public (float Red, float Green, float Blue) ToRgb()

Returns

(float Red, float Green, float Blue)

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

WithOpacity(float)

public Ink WithOpacity(float opacity)

Parameters

opacity float

Returns

Ink

Operators

operator ==(Ink, Ink)

public static bool operator ==(Ink left, Ink right)

Parameters

left Ink
right Ink

Returns

bool

operator !=(Ink, Ink)

public static bool operator !=(Ink left, Ink right)

Parameters

left Ink
right Ink

Returns

bool