Skip to content

Commit

Permalink
Merge pull request #14 from Discordius/patch-1
Browse files Browse the repository at this point in the history
Change type of seed from string to int
  • Loading branch information
mikaello authored Sep 7, 2020
2 parents ce941d0 + e1629b0 commit f529f04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion __tests__/Tinycolor_tests.re
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,13 @@ describe("color utils", () => {

test("random() with options", () => {
let a =
TinyColor.random(~hue=`green, ~luminosity=`bright, ~alpha=0.85, ());
TinyColor.random(
~hue=`green,
~seed=719,
~luminosity=`bright,
~alpha=0.85,
(),
);

expect(TinyColor.getAlpha(a)) |> toBe(0.85);
});
Expand Down
6 changes: 3 additions & 3 deletions src/TinyColor.re
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ external randomConfig:
]
=?,
~luminosity: [@bs.string] [ | `bright | `light | `dark]=?,
~seed: string=?,
~seed: int=?,
~alpha: float=?,
~count: int=?,
unit
Expand All @@ -386,7 +386,7 @@ let random =
],
)=?,
~luminosity: option([ | `bright | `light | `dark])=?,
~seed: option(string)=?,
~seed: option(int)=?,
~alpha: option(float)=?,
(),
) =>
Expand All @@ -408,7 +408,7 @@ let randomMultiple =
],
)=?,
~luminosity: option([ | `bright | `light | `dark])=?,
~seed: option(string)=?,
~seed: option(int)=?,
~alpha: option(float)=?,
~count: int,
(),
Expand Down

0 comments on commit f529f04

Please sign in to comment.