BIM.works SDKs - v3.0.0-b.115
    Preparing search index...
    Index

    Constructors

    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 TinyColor[]

    • 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 TinyColor

    • Gets a new instance with the current color

      Returns TinyColor

    • Gets the complement of the current color

      Returns TinyColor

    • 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 TinyColor

    • 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 TinyColor

    • 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 ColorInput

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

      Returns TinyColor

    • 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 TinyColor

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

      Parameters

      • Optionalresults: number

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

      Returns TinyColor[]

    • 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 TinyColor

    • Sets the alpha value on the current color.

      Parameters

      • alpha: number

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

      Returns TinyColor

    • 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 TinyColor

    • 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 color as [r, g, b, a], every component in 0..1.

      Returns [number, number, number, number]

    • 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

    • Compares two colors. Each colors can be any color inputs.

      Parameters

      Returns boolean

    • Create a tinycolor from components in 0..1.

      Parameters

      • object: { a: number; b: number; g: number; r: number }

      Returns TinyColor

    • Ensure that foreground and background color combinations meet WCAG2 guidelines.

      Parameters

      • color1: ColorInput

        the fore color wanted.

      • color2: ColorInput

        the back color wanted.

      • Optionalwcag2: WCAG2Options

        WCAG option. If the entire object is absent, function use the default of {level:"AA",size:"small"}.

      Returns boolean

    • Given a base color and a list of possible foreground or background colors for that base, returns the most readable color. Optionally returns Black or White if the most readable color is unreadable.

      Parameters

      Returns TinyColor

    • Compares the two colors and returns the constrast between two colors as a number.

      Parameters

      • color1: ColorInput

        the first color to be used in the comparison.

      • color2: ColorInput

        the second color to be used in the comparison.

      Returns number