• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zendeskgarden / react-components / f3d00f1e-ceae-4d36-ba47-a3042f45e7eb

01 Apr 2024 11:34AM UTC coverage: 96.194%. Remained the same
f3d00f1e-ceae-4d36-ba47-a3042f45e7eb

push

circleci

web-flow
chore(deps): update typescript-eslint monorepo to v7

3321 of 3659 branches covered (90.76%)

Branch coverage included in aggregate %.

10076 of 10268 relevant lines covered (98.13%)

215.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.5
/packages/colorpickers/src/utils/conversion.ts
1
/**
2
 * Copyright Zendesk, Inc.
3
 *
4
 * Use of this source code is governed under the Apache License, Version 2.0
5
 * found at http://www.apache.org/licenses/LICENSE-2.0.
6
 */
7

8
export function hslToHsv(h: number, s: number, l: number) {
168✔
9
  let saturation = s;
168✔
10

11
  saturation *= (l < 50 ? l : 100 - l) / 100;
168✔
12
  const v = l + saturation;
168✔
13

14
  return {
168✔
15
    h,
16
    s: v === 0 ? 0 : ((2 * saturation) / v) * 100,
168✔
17
    v
18
  };
19
}
20

21
export function hsvToHsl(h: number, s: number, v: number) {
×
22
  let saturation = s;
×
23
  let value = v;
×
24

25
  saturation /= 100;
×
26
  value /= 100;
×
27

28
  let l = (2 - saturation) * value;
×
29
  let sl = saturation * value;
×
30

31
  sl /= l <= 1 ? l : 2 - l;
×
32
  sl = sl || 0;
×
33
  l /= 2;
×
34

35
  return { h, s: sl * 100, l: l * 100 };
×
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc