Skip to content

Palette generator #18436

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

Closed
wants to merge 3 commits into from
Closed

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Jun 13, 2018

This adds a palette generator that will take an image and generate a set of distinct, dominant colors from it. This is more or less a port of the Android Palette class, except that it doesn't automatically resize the image if it is too large.

For instance, given this image:
landscape

It will generate this palette of colors from it:
palette

Where the leftmost color is the more prominent distinct color, and the rightmost is the least. (Just to be clear, it generates the metadata for the colors, not an image like the one above.... :-)).

[Note that this PR also includes the HSLColor class and changes that are currently up for review in #18294, so you can ignore those and review that PR instead for those changes. I'll merge that one first.]

@gspencergoog gspencergoog force-pushed the palette_generator branch 4 times, most recently from 45e2fc9 to af2935b Compare June 13, 2018 16:54
@Hixie
Copy link
Contributor

Hixie commented Jun 13, 2018

Given how self-contained this code is, would it make sense to publish it as a package instead? It's not clear that it needs to be part of the core framework.

@gspencergoog
Copy link
Contributor Author

Good point. Where do Flutter-maintained packages live? flutter/packages? (which seems to be entirely empty!)

@gspencergoog
Copy link
Contributor Author

Moving this to the flutter/packages repo.
See flutter/packages#2

@lukepighetti
Copy link
Contributor

@gspencergoog any chance you can post it on https://pub.dartlang.org/flutter so we can use this before it gets pulled into flutter/packages ?

(Or is there another way I can use it?)

@zoechi
Copy link
Contributor

zoechi commented Jun 25, 2018

@lukepighetti should just work with https://www.dartlang.org/tools/pub/dependencies#git-packages

@gspencergoog gspencergoog deleted the palette_generator branch October 5, 2018 01:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants