Options
All
  • Public
  • Public/Protected
  • All
Menu

A handler object for dark color, used for variable-based dark color solution

Hierarchy

  • DarkColorHandler

Index

Properties

getDarkColor

A util function to transform light mode color to dark mode color

Readonly knownColors

knownColors: Record<string, Colors>

Map of known colors

Methods

reset

  • reset(): void

updateKnownColor

  • updateKnownColor(isDarkMode: boolean): void
  • updateKnownColor(isDarkMode: boolean, key: string, colorPair: Colors): void
  • Update all known colors to root container.

    Parameters

    • isDarkMode: boolean

      Whether container is in dark mode. When in dark mode, we add CSS color variables for all known colors. When in light mode, we will remove all those CSS color variables

    Returns void

  • Register a known color, and update it to root container via CSS color variable when in dark mode

    Parameters

    • isDarkMode: boolean

      Whether container is in dark mode.

    • key: string

      The key of color, normally it is the name of color variable

    • colorPair: Colors

      A pair value of light color and dark color

    Returns void

Generated using TypeDoc