Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete refactor of the library, add support to control the number of decimals #111

Merged
merged 4 commits into from
May 18, 2023

Conversation

elchininet
Copy link
Owner

This pull request refactors completely the library to add support for decimals control.

The library constructor now accepts a second optional parameter:

ColorTranslator(color: ColorInput, decimals?: number = 6)

By default it is 6 but it can be changed to any value, this will affect the maximum number of decimals for the calculations.

Also a new method and a new property have been added:

instance.setDecimals(value: number);
instance.decimals; // maximum number of decimals

All the properties of a instance are affected by this value.

Also the static methods have now an optional parameter to set the maximum number of decimals (by default 6). Consult the documentation for more details.

Closes #98

@elchininet elchininet merged commit 165f679 into master May 18, 2023
@elchininet elchininet deleted the refactor_library_decimals branch May 18, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HEXA doesn't match when translated to RGBA, and then back to HEXA
1 participant