export function createGradationRectangle ( p , w , h , backgroundColor , fromColor , toColor ) { const g = p . createGraphics ( w , h ) as any ; g . background ( backgroundColor ) ; g . strokeWeight ( 2 ) ; for ( let y = 0 ; y < h ; y += 1 ) { const lerpRatio = y / ( h - 1 ) ; g . stroke ( p . lerpColor ( fromColor , toColor , lerpRatio ) ) ; g . line ( 0 , y , w - 1 , y ) ; } return g ; }