diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-17 19:47:05 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-17 19:47:05 -0400 |
| commit | 3e6f24e4ac4a4b64620d8c9f614f214f8f1c7b94 (patch) | |
| tree | a42f9535bd97f11babeb87b8bd6d631244a459c8 /src/Utils.ts | |
| parent | 1310633790e3db50a31a1cc6d357306d7884a053 (diff) | |
cleanup for animating document icon collapse/expand - still need to fix for docs without native dimensions. lots of lint fixes.
Diffstat (limited to 'src/Utils.ts')
| -rw-r--r-- | src/Utils.ts | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 415023ac4..65eb3cffd 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -115,28 +115,23 @@ export class Utils { // Calculate hue // No difference - if (delta == 0) - h = 0; + if (delta === 0) h = 0; // Red is max - else if (cmax == r) - h = ((g - b) / delta) % 6; + else if (cmax === r) h = ((g - b) / delta) % 6; // Green is max - else if (cmax == g) - h = (b - r) / delta + 2; + else if (cmax === g) h = (b - r) / delta + 2; // Blue is max - else - h = (r - g) / delta + 4; + else h = (r - g) / delta + 4; h = Math.round(h * 60); // Make negative hues positive behind 360° - if (h < 0) - h += 360; // Calculate lightness + if (h < 0) h += 360; // Calculate lightness l = (cmax + cmin) / 2; // Calculate saturation - s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)); + s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)); // Multiply l and s by 100 // s = +(s * 100).toFixed(1); |
