Components Interactions Examples Tutorials API FAQ
Options
Menu

Module Color

Index

Functions

colorTest

  • colorTest(colorTester: Selection<void>, className: string): string
  • Gets the Hex Code of the color resulting by applying the className CSS class to the colorTester selection. Returns null if the tester is transparent.

    Parameters

    • colorTester: Selection<void>

      The d3 selection to apply the CSS class to

    • className: string

      The name of the class to be applied

    Returns string

    The hex code of the computed color

contrast

  • contrast(a: string, b: string): number

lightenColor

  • lightenColor(color: string, factor: number): string
  • Returns a brighter copy of this color. Each channel is multiplied by 0.7 ^ -factor. Channel values are capped at the maximum value of 255, and the minimum value of 30.

    Parameters

    • color: string
    • factor: number

    Returns string

Generated using TypeDoc