interface Instance {
    analogous(results?: number, slices?: number): Instance[];
    brighten(amount?: number): Instance;
    clone(): Instance;
    complement(): Instance;
    darken(amount?: number): Instance;
    desaturate(amount?: number): Instance;
    getAlpha(): number;
    getBrightness(): number;
    getFormat(): string;
    getLuminance(): number;
    getOriginalInput(): tinyColor.ColorInput;
    greyscale(): Instance;
    isDark(): boolean;
    isLight(): boolean;
    isValid(): boolean;
    lighten(amount?: number): Instance;
    monochromatic(results?: number): Instance[];
    saturate(amount?: number): Instance;
    setAlpha(alpha: number): Instance;
    spin(amount: number): Instance;
    splitcomplement(): [Instance, Instance, Instance];
    tetrad(): [Instance, Instance, Instance, Instance];
    toFilter(): string;
    toHex(): string;
    toHex8(): string;
    toHex8String(): string;
    toHexString(): string;
    toHsl(): HSLA;
    toHslString(): string;
    toHsv(): HSVA;
    toHsvString(): string;
    toName(): string | false;
    toPercentageRgb(): PRGBA;
    toPercentageRgbString(): string;
    toRgb(): RGBA;
    toRgbString(): string;
    toString(
        format?:
            | "name"
            | "rgb"
            | "prgb"
            | "hex"
            | "hex6"
            | "hex3"
            | "hex4"
            | "hex8"
            | "hsl"
            | "hsv",
    ): string;
    triad(): [Instance, Instance, Instance];
}

Methods

  • Gets an analogous color scheme based off of the current color.

    Parameters

    • Optionalresults: number

      The amount of results to return. Default value: 6.

    • Optionalslices: number

      The amount to slice the input color by. Default value: 30.

    Returns Instance[]

  • Brighten the color a given amount.

    Parameters

    • Optionalamount: number

      The amount to brighten by. The valid range is 0 to 100. Default value: 10.

    Returns Instance

  • Gets a new instance with the current color

    Returns Instance

  • Gets the complement of the current color

    Returns Instance

  • Darken the color a given amount. Providing 100 will always return black.

    Parameters

    • Optionalamount: number

      The amount to darken by. The valid range is 0 to 100. Default value: 10.

    Returns Instance

  • Desaturate the color a given amount. Providing 100 will is the same as calling greyscale.

    Parameters

    • Optionalamount: number

      The amount to desaturate by. The valid range is 0 to 100. Default value: 10.

    Returns Instance

  • Returns the alpha value of the color

    Returns number

  • Returns the perceived brightness of the color, from 0-255.

    Returns number

  • Returns the format used to create the tinycolor instance.

    Returns string

  • Returns the perceived luminance of a color, from 0-1.

    Returns number

  • Returns the input passed into the constructer used to create the tinycolor instance.

    Returns tinyColor.ColorInput

  • Completely desaturates a color into greyscale. Same as calling desaturate(100).

    Returns Instance

  • Return an indication whether the color's perceived brightness is dark.

    Returns boolean

  • Return an indication whether the color's perceived brightness is light.

    Returns boolean

  • Return an indication whether the color was successfully parsed.

    Returns boolean

  • Lighten the color a given amount. Providing 100 will always return white.

    Parameters

    • Optionalamount: number

      The amount to lighten by. The valid range is 0 to 100. Default value: 10.

    Returns Instance

  • Gets a monochromatic color scheme based off of the current color.

    Parameters

    • Optionalresults: number

      The amount of results to return. Default value: 6.

    Returns Instance[]

  • Saturate the color a given amount.

    Parameters

    • Optionalamount: number

      The amount to saturate by. The valid range is 0 to 100. Default value: 10.

    Returns Instance

  • Sets the alpha value on the current color.

    Parameters

    • alpha: number

      The new alpha value. The accepted range is 0-1.

    Returns Instance

  • Spin the hue a given amount. Calling with 0, 360, or -360 will do nothing.

    Parameters

    • amount: number

      The amount to spin by. The valid range is -360 to 360.

    Returns Instance

  • Returns the color represented as a Microsoft filter for use in old versions of IE.

    Returns string

  • Returns the hex value of the color.

    Returns string

  • Returns the hex 8 value of the color.

    Returns string

  • Returns the hex 8 value of the color -with a # appened.

    Returns string

  • Returns the hex value of the color -with a # appened.

    Returns string

  • Returns the object as a HSLA object.

    Returns HSLA

  • Returns the hsla values interpolated into a string with the following format: "hsla(xxx, xxx, xxx, xx)".

    Returns string

  • Returns the object as a HSVA object.

    Returns HSVA

  • Returns the hsva values interpolated into a string with the following format: "hsva(xxx, xxx, xxx, xx)".

    Returns string

  • The 'real' name of the color -if there is one.

    Returns string | false

  • Returns the object as a RGBA object.

    Returns PRGBA

  • Returns the RGBA relative values interpolated into a string with the following format: "RGBA(xxx, xxx, xxx, xx)".

    Returns string

  • Returns the object as a RGBA object.

    Returns RGBA

  • Returns the RGBA values interpolated into a string with the following format: "RGBA(xxx, xxx, xxx, xx)".

    Returns string

  • String representation of the color.

    Parameters

    • Optionalformat:
          | "name"
          | "rgb"
          | "prgb"
          | "hex"
          | "hex6"
          | "hex3"
          | "hex4"
          | "hex8"
          | "hsl"
          | "hsv"

      The format to be used when displaying the string representation. The accepted values are: "rgb", "prgb", "hex6", "hex3", "hex8", "name", "hsl", "hsv".

    Returns string