Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TColor

Hierarchy

  • Instance
    • TColor

Index

Methods

analogous

  • analogous(results?: undefined | number, slices?: undefined | number): Instance[]
  • Gets an analogous color scheme based off of the current color.

    Parameters

    • Optional results: undefined | number

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

    • Optional slices: undefined | number

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

    Returns Instance[]

brighten

  • brighten(amount?: undefined | number): Instance
  • Brighten the color a given amount.

    Parameters

    • Optional amount: undefined | number

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

    Returns Instance

clone

  • clone(): Instance
  • Gets a new instance with the current color

    Returns Instance

complement

  • complement(): Instance
  • Gets the complement of the current color

    Returns Instance

darken

  • darken(amount?: undefined | number): Instance
  • Darken the color a given amount. Providing 100 will always return black.

    Parameters

    • Optional amount: undefined | number

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

    Returns Instance

desaturate

  • desaturate(amount?: undefined | number): Instance
  • Desaturate the color a given amount. Providing 100 will is the same as calling greyscale.

    Parameters

    • Optional amount: undefined | number

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

    Returns Instance

getAlpha

  • getAlpha(): number
  • Returns the alpha value of the color

    Returns number

getBrightness

  • getBrightness(): number
  • Returns the perceived brightness of the color, from 0-255.

    Returns number

getFormat

  • getFormat(): string
  • Returns the format used to create the tinycolor instance.

    Returns string

getLuminance

  • getLuminance(): number
  • Returns the perceived luminance of a color, from 0-1.

    Returns number

getOriginalInput

  • getOriginalInput(): ColorInput
  • Returns the input passed into the constructer used to create the tinycolor instance.

    Returns ColorInput

greyscale

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

    Returns Instance

isDark

  • isDark(): boolean
  • Return an indication whether the color's perceived brightness is dark.

    Returns boolean

isLight

  • isLight(): boolean
  • Return an indication whether the color's perceived brightness is light.

    Returns boolean

isValid

  • isValid(): boolean
  • Return an indication whether the color was successfully parsed.

    Returns boolean

lighten

  • lighten(amount?: undefined | number): Instance
  • Lighten the color a given amount. Providing 100 will always return white.

    Parameters

    • Optional amount: undefined | number

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

    Returns Instance

monochromatic

  • monochromatic(results?: undefined | number): Instance[]
  • Gets a monochromatic color scheme based off of the current color.

    Parameters

    • Optional results: undefined | number

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

    Returns Instance[]

saturate

  • saturate(amount?: undefined | number): Instance
  • Saturate the color a given amount.

    Parameters

    • Optional amount: undefined | number

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

    Returns Instance

setAlpha

  • setAlpha(alpha: number): 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

  • spin(amount: number): 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

splitcomplement

  • splitcomplement(): [Instance, Instance, Instance]
  • Gets a split complement color scheme based off of the current color.

    Returns [Instance, Instance, Instance]

tetrad

  • tetrad(): [Instance, Instance, Instance, Instance]
  • Gets a tetrad based off of the current color.

    Returns [Instance, Instance, Instance, Instance]

toFilter

  • toFilter(): string
  • Returns the color represented as a Microsoft filter for use in old versions of IE.

    Returns string

toHex

  • toHex(): string
  • Returns the hex value of the color.

    Returns string

toHex8

  • toHex8(): string
  • Returns the hex 8 value of the color.

    Returns string

toHex8String

  • toHex8String(): string
  • Returns the hex 8 value of the color -with a # appened.

    Returns string

toHexString

  • toHexString(): string
  • Returns the hex value of the color -with a # appened.

    Returns string

toHsl

  • toHsl(): HSLA
  • Returns the object as a HSLA object.

    Returns HSLA

toHslString

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

    Returns string

toHsv

  • toHsv(): HSVA
  • Returns the object as a HSVA object.

    Returns HSVA

toHsvString

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

    Returns string

toName

  • toName(): string | false
  • The 'real' name of the color -if there is one.

    Returns string | false

toPercentageRgb

  • toPercentageRgb(): PRGBA
  • Returns the object as a RGBA object.

    Returns PRGBA

toPercentageRgbString

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

    Returns string

toRgb

  • toRgb(): RGBA
  • Returns the object as a RGBA object.

    Returns RGBA

toRgbString

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

    Returns string

toScalar

  • toScalar(): Scalar

toString

  • toString(format?: "rgb" | "prgb" | "hex" | "hex6" | "hex3" | "hex4" | "hex8" | "name" | "hsl" | "hsv"): string
  • String representation of the color.

    Parameters

    • Optional format: "rgb" | "prgb" | "hex" | "hex6" | "hex3" | "hex4" | "hex8" | "name" | "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

triad

  • triad(): [Instance, Instance, Instance]
  • Gets a triad based off of the current color.

    Returns [Instance, Instance, Instance]

Generated using TypeDoc