import type { Canvas } from "./canvas.ts"; export interface Point { x: number; y: number; } export interface StrokeStyle { color?: string; width?: number; opacity?: number; /** * Overrides `color`: the stroke is colored by interpolating these stops * instead of a single flat color — along the route's own on-canvas length * by default (see `colorBy`). `"rainbow"` is a built-in ROYGBIV preset; * otherwise a list of 2+ hex colors. */ gradient?: readonly string[] | "rainbow"; /** * What determines each point's position along `gradient`. `"length"` * (default) is on-canvas pixel distance walked. `"elevation"`/`"speed"` * use that point's value, normalized to this route's own min/max — GPX * data `renderRoute` doesn't have, so those only take effect via * `renderGpx`, and only when the underlying data (2+ points with ``, * or 2+ points with usable consecutive `