Skip to content

add support for tree-shaking#112

Draft
LitoMore wants to merge 1 commit intoQix-:masterfrom
LitoMore:tree-shaking
Draft

add support for tree-shaking#112
LitoMore wants to merge 1 commit intoQix-:masterfrom
LitoMore:tree-shaking

Conversation

@LitoMore
Copy link
Copy Markdown
Collaborator

@LitoMore LitoMore commented Feb 5, 2025

Changes

  • Add support for tree-shaking

Need a discussion

My current implementation is to export two types of functions like this below, one is for the raw and another is for the rounded:

export const rgbToHslRaw = rgb => {
	const r = rgb[0] / 255;
	const g = rgb[1] / 255;
	const b = rgb[2] / 255;
	return [h, s * 100, l * 100];
};

export const rgbToHsl = wrapRounded(rgbToHslRaw);

What do you think?

@dasa
Copy link
Copy Markdown

dasa commented May 16, 2025

This looks like a great change since currently this package is a little large: https://bundlephobia.com/package/color-convert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants