Releases: mikaello/rescript-tinycolor
v5.1.1
v5.1.0
Enhancements
- chore(deps): update dependency rescript to v12 by @renovate[bot] in #53
- fix(deps): update dependency @ctrl/tinycolor to v4 by @renovate[bot] in #41
- This PR changed a lot more that had to be fixed
Other changes
- build(deps): bump jsdom from 16.4.0 to 16.7.0 by @dependabot[bot] in #25
- Configure Renovate by @renovate[bot] in #26
- fix(deps): pin dependencies by @renovate[bot] in #27
- chore(deps): update dependency @glennsl/bs-jest to v0.7.0 by @renovate[bot] in #28
- chore(deps): update dependency rescript to v10 by @renovate[bot] in #31
- build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 by @dependabot[bot] in #32
- build(deps): bump minimatch from 3.0.4 to 3.1.2 by @dependabot[bot] in #33
- build(deps): bump json5 from 2.1.3 to 2.2.3 by @dependabot[bot] in #34
- chore(deps): update dependency rescript to v10.1.2 by @renovate[bot] in #35
- chore(deps): update dependency rescript to v10.1.3 by @renovate[bot] in #36
- chore(deps): update dependency rescript to v10.1.4 by @renovate[bot] in #37
- chore(deps): update actions/checkout action to v4 by @renovate[bot] in #42
- build(deps): bump tough-cookie from 4.0.0 to 4.1.3 by @dependabot[bot] in #38
- build(deps): bump semver from 5.7.1 to 5.7.2 by @dependabot[bot] in #39
- build(deps): bump word-wrap from 1.2.3 to 1.2.4 by @dependabot[bot] in #40
- build(deps): bump @babel/traverse from 7.12.12 to 7.23.2 by @dependabot[bot] in #43
- chore(deps): update actions/setup-node action to v4 by @renovate[bot] in #44
- build(deps): bump ws from 7.5.8 to 7.5.10 by @dependabot[bot] in #46
- chore(deps): update actions/checkout action to v5 by @renovate[bot] in #48
- chore(deps): update actions/setup-node action to v5 by @renovate[bot] in #49
- build(deps): bump form-data from 3.0.1 to 3.0.4 by @dependabot[bot] in #47
- chore(deps): update actions/checkout action to v6 by @renovate[bot] in #51
- chore(deps): update actions/setup-node action to v6 by @renovate[bot] in #50
New Contributors
Full Changelog: v5.0.0...v5.1.0
v5.0.0
Changes
Rewriting all code from Bucklescript to Rescript
Breaking changes
The functions
- analogous
- monochromatic
- polyad
... did previously have data last, but now have data first (previously |>, now ->). All parameters except t are optional, but does now require a unit (()) since we are doing data first.
In code:
// Previously
TinyColor.random() |> TinyColor.analogous(~slices=10)
TinyColor.random() |> TinyColor.polyad
// Now
TinyColor.random()->TinyColor.analogous(~slices=10, ())
TinyColor.random()->TinyColor.polyad()v4.0.0
Renamed the repository to rescript-tinycolor from bs-tinycolor to adhere to the standard described in the ReScript forum: https://forum.rescript-lang.org/t/ann-rescript-package-index-release/801
The breaking changes:
- Package name is now
rescript-tinycolor(instead ofbs-tinycolor- Remember to update both
package.jsonandbsconfig.json
- Remember to update both
- In the code you need to access module
RescriptTinycolorinstead ofBsTinycolor:- open BsTinycolor + open RescriptTinycolor
v3.2.0
Updated to @ctrl/tinycolor v3.3.1, which includes the new method onBackground:
(onBackground) Compute how the color would appear on a background. When the color is fully transparent (i.e.
getAlpha() == 0), the result will be the background color. When the color is not transparent at all (i.e.getAlpha() == 1), the result will be the color itself. Otherwise you will get a computed result.
Example from tests:
let blue = TinyColor.makeFromString("blue");
let red = TinyColor.makeFromString("red");
switch (blue, red) {
| (Some(blue), Some(red)) =>
let bluePartlyTransparent = TinyColor.setAlpha(0.5, blue);
expect(
TinyColor.onBackground(bluePartlyTransparent, red) |> TinyColor.toHexString,
) == "#800080";
| _ => expect(true) == false
}v3.1.2
v3.1.1
v3.1.0
v2.0.2
Enhanced functions that have config objects
This release has better handling of configs for a handful of bindings, using optional parameters instead of makeSomeConfig(...) and using polymorphic variants for enums.
New features
Config options is now available for random(). To get multiple random colors the new function randomMultiple() can be used (and then the labeled count parameter must be provided). This is in par with the BuckleScript-bindings for randomColor (the original randomColor lib has the same implementation as tinyColors random-implementation).
Breaking changes
-
mostReadable, the parameterssizeandlevelare now polymporphic variants:TinyColor.mostReadable( ~includeFallbackColors=true, ~level=`AAA, /* Before this was "AAA" / "AA" */ ~size=`small, /* Before this was "small" / "large" */ [|comp1, comp2|], color, )
-
isReadable, the parameterssizeandlevelare now polymporphic variants:TinyColor.isReadable( ~level=`AAA, /* Before this was "AAA" / "AA" */ ~size=`small, /* Before this was "small" / "large" */ color1, color2, )
-
isReadableOptionis removed in favor of options toisReadable.