package color

  1. Overview
  2. Docs

Install

Dune Dependency

Authors

Maintainers

Sources

color-0.2.0.tbz
sha256=f0166375a7c59c54d3cfbe5b7bee6f2673f8dafaf81477cbb7eea810cd50e371
md5=36a5d45385a02f96d07d40d1b0fbcf8a

Description

Converts between different color formats

Library that converts between different color formats. Right now it deals with HSL, HSLA, RGB and RGBA formats.

The goal for this library is to provide easy handling of colors on the web, when working with js_of_ocaml.

Published: 21 Sep 2018

README

color: converts between different color formats

Library that converts between different color formats. Right now it deals with HSL, HSLA, RGB and RGBA formats.

The goal for this library is to provide easy handling of colors on the web, when working with js_of_ocaml.

Examples

# Color.to_hexstring (Color.of_rgb 12 121 229);;
- : "#0c79e5"

The library uses the color type from Gg.

# Color.to_css_hsla (Gg.Color.red);;
- : string = "hsl(0.00, 100.00%, 50.00%)"

# Color.to_css_rgba (Gg.Color.red);;
- : string = "rgb(255, 0, 0)"

# Color.to_hexstring (Color.complementary (Gg.Color.red));;
- : string = "#00ffff"

Credit

Based on purescript-colors

Dependencies (3)

  1. gg
  2. dune
  3. ocaml >= "4.05.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by (1)

  1. spectrum

Conflicts

None

OCaml

Innovation. Community. Security.