ThemeColors interface

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature

  1. export interface ThemeColors extends ThemeColorsBase<ThemeRichColor>

Import

  1. import { ThemeColors } from '@grafana/data';

Methods

MethodDescription
emphasize(color, amount)(BETA)
getContrastText(background, threshold)(BETA) Returns a text color for the background

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

emphasize method

Signature

  1. emphasize(color: string, amount?: number): string;

Parameters

ParameterTypeDescription
colorstring
amountnumber

Returns:

string

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

getContrastText method

Returns a text color for the background

Signature

  1. getContrastText(background: string, threshold?: number): string;

Parameters

ParameterTypeDescription
backgroundstring
thresholdnumber

Returns:

string