bs-parse-color

0.6.1 • Public • Published

bs-parse-color

License: MIT CircleCI

Pretty naive BuckleScript bindings for parse-color

I'm very new to Reason, so i do not recommend using this for anything more than a toy, please open an issue / leave comments if you have a better ideas on some of the parts.

Installation

With yarn

yarn add bs-parse-color

Or with npm

npm install bs-parse-color

Then add bs-parse-color to your bsconfig.json file as a dependency

{
  ...
  "bs-dependencies": [ "bs-parse-color" ]
  ...
}

Usage

/* call .parse with an argument of any color type */
let col = "orange" | "#FF6600" | "rgb(10,20,30)" | "rgba(10,20,20,0.5)" ...
let parsed = ParseColor.parse(col);

/* convert the parsed color into another type */
parsed |> asHex;
parsed |> asRgba;
parsed |> asCmkya;

/* access a color mode */
parsed.rgba

Package Sidebar

Install

npm i bs-parse-color

Weekly Downloads

0

Version

0.6.1

License

MIT

Unpacked Size

28.3 kB

Total Files

10

Last publish

Collaborators

  • theatlasroom