Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

getTagColorsFromName() function

getTagColorsFromName() function

Returns tag badge background and border colors based on hashed tag name.

Signature

typescript
export declare function getTagColorsFromName(name?: string): {
    color: string;
    borderColor: string;
};

Import

typescript
import { getTagColorsFromName } from '@grafana/ui';

Parameters

ParameterTypeDescription
namestringtag name

Returns:

{ color: string; borderColor: string; }