package ocaml-canvas

  1. Overview
  2. Docs

Gradient manipulation functions

type t

An abstract type representing a gradient

val createLinear : pos1:Point.t -> pos2:Point.t -> t

createLinear ~pos1 ~pos2 creates a new linear gradient parallel to the line (pos1, pos2) in window coordinates

val createRadial : center1:Point.t -> rad1:float -> center2:Point.t -> rad2:float -> t

createRadial ~center1 ~rad1 ~center2 ~rad2 creates a new radial gradient between the disks with centers center1 and center2 and radi rad1 and rad2 in window coordinates

val createConic : center:Point.t -> angle:float -> t

createConic ~center ~angle creates a new conic gradient with center center and initial angle angle

val addColorStop : t -> Color.t -> float -> unit

addColorStop gradient color stop adds a new color color spot in the gradient object at position stop


Innovation. Community. Security.