MCPcopy Create free account
hub / github.com/aptabase/aptabase / createLinearGradient

Function createLinearGradient

src/webapp/features/theme/useChartColors.ts:5–10  ·  view source on GitHub ↗
(chart: Chart, color1: string, color2: string)

Source from the content-addressed store, hash-verified

3import { useTheme } from "./ThemeProvider";
4
5function createLinearGradient(chart: Chart, color1: string, color2: string): CanvasGradient | string {
6 const gradient = chart.ctx.createLinearGradient(0, 0, 0, chart.height);
7 gradient.addColorStop(0, color1);
8 gradient.addColorStop(1, color2);
9 return gradient;
10}
11
12type ChartColors = {
13 primary: string;

Callers 1

getColorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected