1import * as _ from 'lodash-es'2import { paintTrail } from './paintTrailF.mts'4export type Trail = {5 points: [number, number][]6 color: string7 cursorSize: number8}10export const renderGameCanvasBg = ({ctx, width, height}: {ctx: CanvasRenderingContext2D, width: number, height: number}) => {11 ctx.beginPath()12 ctx.fillStyle = 'white'13 ctx.rect(0,0, width, height)14 ctx.fill()15 ctx.closePath()16}18export const renderFinishedTrails = ({ctx, finishedTrails}: {ctx: CanvasRenderingContext2D, finishedTrails: Trail[]}) => {19 _.reverse(_.clone(finishedTrails)).forEach((trail: Trail) => paintTrail({ctx, trail}))20}