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

add Google's algorithm #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

filipeglfw
Copy link

Added two new algorithms:

Google

This will reproduce exactly what Google's color tool generates.
Sometimes this tool slightly changes the input color. For exemple, when inputing #350094 it will return a pallete with #340094

Google exact

I am terrible at naming things, so you're welcome to change this.
I've tweaked the code from the previous algorithm so that it will return the input value exactly.


Google's original Material Palletes did not have A colors for the Brown, Gray and Blue Gray, so that the algorithm will not return A colors in case the input is close to those.

Closes #118

@filipeglfw
Copy link
Author

filipeglfw commented May 27, 2020

Just as a reference, here are the palletes generated with the algorithm compared to the one from Google's documentation.

image

@SimonIT
Copy link

SimonIT commented Jan 22, 2022

@mbitson

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.

Add Google's algorithm
2 participants