Options
All
  • Public
  • Public/Protected
  • All
Menu

A class that provides utilities to interact with TinyColor library.

class

Hierarchy

  • ColorUtils

Index

Methods

Static areEqual

  • areEqual(color1: string, color2: string): boolean
  • Returns whether to color strings are equal.

    Parameters

    • color1: string

      The first color to test if equal.

    • color2: string

      The second color to test if equal.

    Returns boolean

    Returns true if equal. Otherwise false.

Static mostReadable

  • mostReadable(baseColor: any, colorList: any[]): string
  • Determine a readable color from a base color and list of possible colors.

    Parameters

    • baseColor: any

      The base color of which to test for readable color.

    • colorList: any[]

      A list of possible colors.

    Returns string

    Returns the most readable color.

Static toRgba

  • Converts a color string to its RgbaColor equivalent. Any alpha values will be normalized to int[0-255].

    Parameters

    • color: string

      The color string to convert.

    Returns RgbaColor

    Returns the RgbaColor.

Static toRgbaString

  • toRgbaString(color: any): string
  • Converts a color string or RgbaColor to an RGBA string.

    Parameters

    • color: any

      The color string or RgbaColor to convert.

    Returns string

    Returns the RGBA string.

Generated using TypeDoc