Skip to content

Commit

Permalink
refactor: hsltorgb helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bart-krakowski committed Jun 14, 2021
1 parent ba7049b commit 088dda5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/p2/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const hslToRgb = ({ h, s, l }) => {
}
return { r, g, b };
};
function rgbToHsl({ r, g, b }) {
const rgbToHsl = ({ r, g, b }) => {
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
let h;
Expand Down Expand Up @@ -94,7 +94,7 @@ function rgbToHsl({ r, g, b }) {
s: s * 100,
l: l * 100,
};
}
};
const colorLuminance = ({ h, s, l }, range) => {
const colors = [];
for (let i = range[0]; i < range[1]; i++) {
Expand Down
6 changes: 1 addition & 5 deletions packages/p2/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ const hslToRgb = ({ h, s, l }: HSL) => {
return { r, g, b }
}

function rgbToHsl({ r, g, b }) {
// r /= 255
// g /= 255
// b /= 255

const rgbToHsl = ({ r, g, b }) => {
const max = Math.max(r, g, b)
const min = Math.min(r, g, b)
let h
Expand Down

0 comments on commit 088dda5

Please sign in to comment.