Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColourHsl

Represents a colour in the hue, saturation and lightness colour model. Internal values are HDR and can eclipse the 0 to 1 range. The values are clamped when accessed. This class is used to calculate the divisions in the Colour class by lightening/darkening the colour to create a colour palette

example
Construct with hue angle and percentage saturation and lightness values values ```ts const rgb = new Rgb({ hue: 260, green: 1, blue: 0.63}); rgb.toString(); // -> '#8040ff' ```

Hierarchy

  • ColourHsl

Index

Constructors

constructor

  • new ColourHsl(__namedParameters: object): ColourHsl
  • Parameters

    • __namedParameters: object
      • hue: string | number | IImmutable<string | number> | Degrees
      • lightness: number
      • saturation: number

    Returns ColourHsl

Accessors

h

  • get h(): Degrees

l

  • get l(): number

s

  • get s(): number

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string
  • Parameters

    • hint: "string" | "number" | "default"

    Returns number | string

darken

  • darken(__namedParameters: object): ColourHsl
  • Parameters

    • __namedParameters: object
      • delta: undefined | number
      • ratio: undefined | number

    Returns ColourHsl

lighten

  • lighten(__namedParameters: object): ColourHsl
  • Parameters

    • __namedParameters: object
      • delta: undefined | number
      • ratio: undefined | number

    Returns ColourHsl

toHex

  • toHex(): Hex

toIHsl

  • toIHsl(): IHsl

toIRgb

  • toIRgb(): IRgb

toString

  • toString(): string

valueOf

  • valueOf(): string