@tempots/color

XYZ class

Represents a color in the XYZ color space.

Signature:

declare class XYZ 

Constructors

Constructor

Modifiers

Description

(constructor)(x, y, z)

Creates a new instance of the XYZ class.

Properties

Property

Modifiers

Type

Description

equals

readonly

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

Checks if the current XYZ object is equal to another XYZ object.

ofChannels

static

readonly

([x, y, z]: [x: number, y: number, z: number]) => XYZ

Creates a new XYZ instance from an array of channel values.

toChannels

readonly

() => [number, number, number]

Converts the XYZ color values to an array of channels.

toString

readonly

() => string

Returns a string representation of the XYZ object. The string is formatted as "XYZ(x, y, z)".

withX

readonly

(x: number) => XYZ

Returns a new XYZ instance with the specified x-coordinate.

withY

readonly

(y: number) => XYZ

Returns a new XYZ instance with the specified y coordinate.

withZ

readonly

(z: number) => XYZ

Returns a new XYZ instance with the specified z-coordinate.

x

readonly

number

Represents the x-coordinate.

y

readonly

number

Represents the y coordinate.

z

readonly

number

Represents the z-coordinate.