Skip to content

add support for tree-shaking - #112

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

LitoMore wants to merge 1 commit into
Qix-:masterfrom
LitoMore:tree-shaking

Conversation

@LitoMore

@LitoMore LitoMore commented Feb 5, 2025 •

Copy link
Copy Markdown
Collaborator

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?

Comment thread README.md Resolved
Comment thread conversions.js Resolved
@dasa

dasa commented May 16, 2025

Copy link
Copy Markdown

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