Module Oklab

type t

represents a point in the oklab color space

val sexp_of_t : t -> Sexplib0.Sexp.t

constructors

val create : l:Base.float -> a:Base.float -> b:Base.float -> ?alpha:Base.float -> Base.unit -> t

Create using direct Oklab values.

val of_rgb : r:Base.float -> g:Base.float -> b:Base.float -> ?alpha:Base.float -> Base.unit -> t

Each of r, g, b, and alpha must be in the range 0 to 1

val of_rgb' : r:Base.int -> g:Base.int -> b:Base.int -> ?alpha:Base.float -> Base.unit -> t

Each of r, g, b must be in the range 0 to 255. alpha must be in the range 0 to 1

val of_rgb_hex : Base.string -> t

Parses css hex rgba colors

val to_string_css : t -> Base.string

Formats the color for use in a css color, in rgb notation

val to_string_hex : t -> Base.string

Formats the color for use in a css color, in hex notation

val lightness : t -> Base.float
val alpha : t -> Base.float
val set_lightness : t -> Base.float -> t
val set_alpha : t -> alpha:Base.float -> t
val lerp : t -> t -> Base.float -> t

lerp start end mult produces a color that is between start and end as determined by mult, which must be in the range 0 to 1

val composite : under:t -> over:t -> t

Builds a color that is the result of compositing over on top of under taking trasnparencies into account.

val inside_rgb : t -> Base.bool
module Lch : sig ... end