Skip to main content Link Search Menu Expand Document (external link)

Color.ts overview

This module defines the abstract Color type, the base for all ANSI color kinds (ThreeBit, EightBit, and RGB)


Exports Grouped by Category


Destructors

toString

Gets the id of self

Signature

declare const toString: MTypes.OneArgFunction<Type, string>

Source

Equivalences

equivalence

Equivalence

Signature

declare const equivalence: Equivalence.Equivalence<Type>

Source

Getters

backgroundId

Gets the background id of self

Signature

declare const backgroundId: (self: Type) => string

Source

backgroundSequence

Gets the background sequence of self

Signature

declare const backgroundSequence: (self: Type) => ASSequence.OverOne

Source

foregroundId

Gets the foreground id of self

Signature

declare const foregroundId: (self: Type) => string

Source

foregroundSequence

Gets the foreground sequence of self

Signature

declare const foregroundSequence: (self: Type) => ASSequence.OverOne

Source

Models

Type (class)

Color Type

Signature

declare class Type {
  constructor({
    foregroundId,
    foregroundSequence
  }: {
    readonly foregroundId: string
    readonly foregroundSequence: ASSequence.OverOne
  })
}

Source

[MData.idSymbol] (method)

Returns the id of this

Signature

declare const [MData.idSymbol]: () => string | (() => string)

Source

foregroundId (property)

Id of this color used as foreground color

Signature

readonly foregroundId: string

Source

backgroundId (property)

Id of this color used as background color

Signature

readonly backgroundId: string

Source

foregroundSequence (property)

Sequence of this color used as foreground color

Signature

readonly foregroundSequence: ASSequence.OverOne

Source

backgroundSequence (property)

Sequence of this color used as background color

Signature

readonly backgroundSequence: ASSequence.OverOne

Source

Module markers

moduleTag

Module tag

Signature

declare const moduleTag: "@parischap/ansi-styles/Color/"

Source