Skip to content

Commit

Permalink
Clean up deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
danburzo committed Aug 8, 2021
1 parent 00fa5d5 commit 49a43b5
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 459 deletions.
16 changes: 2 additions & 14 deletions src/clamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fixup_rgb = color => {
return c;
};

const clampRgb = color => {
export const clampRgb = color => {
color = prepare(color);

// if the color is undefined or displayable, return it directly
Expand All @@ -25,7 +25,7 @@ const clampRgb = color => {
return conv(fixup_rgb(color));
};

const clampChroma = (color, mode = 'lch') => {
export const clampChroma = (color, mode = 'lch') => {
color = prepare(color);

// if the color is undefined or displayable, return it directly
Expand Down Expand Up @@ -68,15 +68,3 @@ const clampChroma = (color, mode = 'lch') => {
displayable(clamped) ? clamped : { ...clamped, c: _last_good_c }
);
};

// Deprecated / no longer documented
const clamp = (method = 'rgb') => {
switch (method) {
case 'rgb':
return clampRgb;
case 'lch':
return clampChroma;
}
};

export { clampRgb, clampChroma, clamp };
Loading

0 comments on commit 49a43b5

Please sign in to comment.