Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HSVSpace

Hierarchy

  • default
    • HSVSpace

Index

Constructors

Properties

type: "hsv"
converter: default<HSVColorSpace>

Methods

  • hue(): number
  • Retrieves the value of the hue channel for the current color space.

    Returns number

    the hue channel value of this color space

  • saturation(): number
  • Retrieves the value of the saturation channel for the current color space.

    Returns number

    the saturation channel value of this color space

  • value(): number
  • Retrieves the value of the lightness channel for the current color space.

    Returns number

    the lightness channel value of this color space

  • Retrieves a color channel from the HSV color space via key.

    example

    Here's a simple example retrieving each channel

    hsl.toString() // hsl(210,100%,50%)
    hsl.color('hue') // 210
    hsl.color('saturation') // 100
    hsl.color('lightness') // 50

    Parameters

    • color: keyof HSVColorSpace

      the name of the channel from the current color space to retrieve

    Returns number

    the value of the channel matching the provided key

  • toArray(): [number, number, number]
  • Retrieves an array representing the HSV color space containing the primary colors.

    remarks

    Array index is ordered logically [HSV]

    Returns [number, number, number]

    the HSV color space values as an array

  • toHexString(removeHashtag?: boolean): string
  • Returns a hex string representing the RGB color space. This ignores any alpha values.

    Example

    color.toString() // hsl(25,40%,54%)
    color.toHexString() // #b9825b
    color.toHexString(true) // b9825b

    Parameters

    • Optional removeHashtag: boolean

      will return the hex value without a hashtag if true, otherwise will return with hashtag

    Returns string

  • Retrieves an object representing the RGBA color space containing the primary colors and alpha values.

    Returns HSVColorSpace

    the HSV color space values

  • toString(): string
  • Prints valid CSS string value.

    example

    Here's a simple usage example:

    color.toString() // hsl(25,40%,54%)
    

    Returns string

    valid CSS color value.

Generated using TypeDoc