@tempots/color

CMYK class

Represents a color in the CMYK color model.

Signature:

declare class CMYK 

Constructors

Constructor

Modifiers

Description

(constructor)(cyan, magenta, yellow, black)

Represents a CMYK color.

Properties

Property

Modifiers

Type

Description

black

readonly

number

Represents the cyan component in the CMYK color model.

cyan

readonly

number

Represents the cyan component in the CMYK color model.

equals

readonly

(other: CMYK, tollerance?: number) => boolean

Checks if the current CMYK color is equal to another CMYK color.

fromString

static

readonly

(s: string) => CMYK

Creates a CMYK color instance from a string representation. The string should be in the format "cmyk(c%, m%, y%, k%)".

magenta

readonly

number

Represents the cyan component in the CMYK color model.

ofChannels

static

readonly

([cyan, magenta, yellow, black]: [cyan: number, magenta: number, yellow: number, black: number]) => CMYK

Creates a new CMYK color instance from the given channel values.

toChannels

readonly

() => [number, number, number, number]

Converts the CMYK color values to an array of channels.

toString

readonly

() => string

Returns a string representation of the CMYK color in the format "cmyk(cyan%, magenta%, yellow%, black%)".

withBlack

readonly

(black: number) => CMYK

Creates a new CMYK color with the specified black value.

withCyan

readonly

(cyan: number) => CMYK

Returns a new CMYK color with the specified cyan value.

withMagenta

readonly

(magenta: number) => CMYK

Returns a new CMYK color with the specified magenta value.

withYellow

readonly

(yellow: number) => CMYK

Returns a new CMYK color with the specified yellow value.

yellow

readonly

number

Represents the cyan component in the CMYK color model.