Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Utils/ColorUtils

Index

Functions

  • colorToHsl(color: undefined | string | IColor, index?: number, useIndex?: boolean): IHsl | undefined
  • Gets the particles color

    Parameters

    • color: undefined | string | IColor

      the input color to convert in IHsl object

    • Optional index: number

      the array index, if needed

    • useIndex: boolean = true

      set to false to ignore the index parameter

    Returns IHsl | undefined

    the IHsl object

  • colorToRgb(input?: string | IColor, index?: number, useIndex?: boolean): IRgb | undefined
  • Gets the particles color

    Parameters

    • Optional input: string | IColor

      the input color to convert in IRgb object

    • Optional index: number

      the array index, if needed

    • useIndex: boolean = true

      set to false to ignore the index parameter

    Returns IRgb | undefined

  • getLinkRandomColor(optColor: string | IColor, blink: boolean, consent: boolean): IRgb | string | undefined
  • getRandomRgbColor(min?: number): IRgb
  • getStyleFromHsl(color: IHsl, opacity?: number): string
  • Gets a CSS style string from a IHsl object and opacity value

    Parameters

    • color: IHsl

      the IHsl input color

    • Optional opacity: number

      the opacity value

    Returns string

    the CSS style string

  • getStyleFromHsv(color: IHsv, opacity?: number): string
  • Gets a CSS style string from a IHsv object and opacity value

    Parameters

    • color: IHsv

      the IHsv input color

    • Optional opacity: number

      the opacity value

    Returns string

    the CSS style string

  • getStyleFromRgb(color: IRgb, opacity?: number): string
  • Gets a CSS style string from a IRgb object and opacity value

    Parameters

    • color: IRgb

      the IRgb input color

    • Optional opacity: number

      the opacity value

    Returns string

    the CSS style string

  • stringToAlpha(input: string): number | undefined
  • Gets alpha value from string color

    Parameters

    • input: string

      the input color to convert in alpha value

    Returns number | undefined

    the alpha value

  • stringToRgb(input: string): IRgb | undefined
  • Converts hexadecimal string (HTML color code) in a IRgb object

    Parameters

    • input: string

      the hexadecimal string (#f70 or #ff7700)

    Returns IRgb | undefined

    the IRgb object