A color manipulation library for ReScript, written in ReScript. Provides manipulation functions and internal types for different kinds of color values.
There are also bindings to bs-css to make usage of this library easy with color types from it.
yarn add @rohea/colores-bs-css
Then add @rohea/colores and @rohea/colores-bs-css to bs-dependencies in your rescript.json.
let myClass = CssJs.style([
CssJs.backgroundColor(#hex("ff0000")->ColorCssJs.darken(0.5))
])
yarn add @rohea/colores
Then add @rohea/colores to bs-dependencies in your rescript.json.
- darken
- desaturate
- invert
- lighten
- mix
- opacify
- readable
- shade
- tint
- transparentize
- setAlpha
New functions are added as soon as we need them or someone makes a nice pull request :)
- Checkout the repository
- Run
yarn install(using Yarn version 1.22.x) - Run
yarn res-buildto make a full ReScript build - Run
yarn examplesto start example page with Parcel - Run
yarn watchin a separate console to start watching ReScript file changes