Constructors

Methods

  • Allows to get or change an alpha channel value.

    Returns number

  • Parameters

    • value: number

    Returns Colord

  • Increases the HSL lightness of a color by the given amount.

    Parameters

    • Optionalamount: number

    Returns Colord

  • Decreases the HSL saturation of a color by the given amount.

    Parameters

    • Optionalamount: number

    Returns Colord

  • Makes a gray color with the same lightness as a source color.

    Returns Colord

  • Allows to get or change a hue value.

    Returns number

  • Parameters

    • value: number

    Returns Colord

  • Creates a new instance containing an inverted (opposite) version of the color.

    Returns Colord

  • Same as calling brightness() < 0.5.

    Returns boolean

  • Determines whether two values are the same color.

    Parameters

    Returns boolean

  • Same as calling brightness() >= 0.5.

    Returns boolean

  • Returns a boolean indicating whether or not an input has been parsed successfully. Note: If parsing is unsuccessful, Colord defaults to black (does not throws an error).

    Returns boolean

  • Increases the HSL lightness of a color by the given amount.

    Parameters

    • Optionalamount: number

    Returns Colord

  • Changes the HSL hue of a color by the given amount.

    Parameters

    • Optionalamount: number

    Returns Colord

  • Increases the HSL saturation of a color by the given amount.

    Parameters

    • Optionalamount: number

    Returns Colord

  • Returns the hexadecimal representation of a color. When the alpha channel value of the color is less than 1, it outputs #rrggbbaa format instead of #rrggbb.

    Returns string

  • Converts a color to HSL color space and returns an object. Always includes an alpha value from 0 to 1.

    Parameters

    • Optionaldigits: number

    Returns HslaColor

  • Converts a color to HSL color space and returns a string representation. Always includes an alpha value from 0 to 1.

    Parameters

    • Optionaldigits: number

    Returns string

  • Converts a color to HSV color space and returns an object. Always includes an alpha value from 0 to 1.

    Parameters

    • Optionaldigits: number

    Returns HsvaColor

  • Converts a color to RGB color space and returns an object. Always includes an alpha value from 0 to 1.

    Parameters

    • Optionaldigits: number

    Returns RgbaColor

  • Converts a color to RGB color space and returns a string representation. Outputs an alpha value only if it is less than 1.

    Parameters

    • Optionaldigits: number

    Returns string

Properties

rgba: RgbaColor