colorManipulator.asHexString() function

colorManipulator.asHexString() function

Converts a color to hex6 format if there is no alpha, hex8 if there is.

Signature

  1. export declare function asHexString(color: string): string;

Import

  1. import { colorManipulator } from '@grafana/data';
  2. const { asHexString } = colorManipulator;

Parameters

ParameterTypeDescription
colorstringHex, RGB, HSL color

Returns:

string

A hex color string, i.e. #ff0000 or #ff0000ff