Skip to content

Commit

Permalink
fix: correct lightness value (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
believer authored Mar 5, 2019
1 parent de12b4d commit 4925a75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/Color_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("#score", () => {
);

test("handles hsl colors with lightness higher than 50", () =>
expect(Color.score("hsl(210, 30%, 68%)", "#ffffff")) |> toEqual(2.35)
expect(Color.score("hsl(210, 30%, 68%)", "#ffffff")) |> toEqual(2.31)
);

test("handles two hsl colors", () =>
Expand Down
2 changes: 1 addition & 1 deletion src/HSL.re
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let createRgbFromHsl = (h, s, l) => {

let q =
switch (l) {
| l when l < 50.0 => l *. (1.0 +. s)
| l when l < 0.5 => l *. (1.0 +. s)
| _ => l +. s -. l *. s
};
let p = 2.0 *. l -. q;
Expand Down

0 comments on commit 4925a75

Please # to comment.