UNPKG

zz-chart

Version:

Alauda Chart components by Alauda Frontend Team

33 lines (32 loc) 1.09 kB
/// <reference types="web" /> /// <reference types="d3-shape" /> export declare function getCanvasContext(): CanvasRenderingContext2D; export declare function getOpacityGradientFn(color: string, opacity: number): (self: uPlot, seriesIdx: number) => CanvasGradient; export declare function alpha(color: string, value: number): string; interface DecomposeColor { type: string; values: any; colorSpace?: string; } /** * Converts a color object with type and values to a string. * @param {object} color - Decomposed color * @param color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla' * @param {array} color.values - [n,n,n] or [n,n,n,n] * @returns A CSS color string * @beta */ export declare function recomposeColor(color: DecomposeColor): string; export declare enum GradientDirection { Right = 0, Up = 1, Left = 2, Down = 3 } export declare enum ScaleOrientation { Horizontal = 0, Vertical = 1 } export declare function decomposeColor(color: string | DecomposeColor): DecomposeColor; export declare function hexToRgb(color: string): string; export {};