Repository navigation
Add the palette_generator package to the packages repo - #2
Merged
Merged
Conversation
gspencergoog
force-pushed
the
palette_generator
branch
3 times, most recently
from
June 15, 2018 19:53
eddc4c5 to
d055aff
Compare
gspencergoog
force-pushed
the
palette_generator
branch
3 times, most recently
from
June 19, 2018 05:21
be0a65a to
6b14c98
Compare
Contributor
Author
|
This is ready for review. The people who requested this would like it comitted by Wednesday if at all possible. |
gspencergoog
force-pushed
the
palette_generator
branch
5 times, most recently
from
June 19, 2018 16:52
98ad172 to
14f3c9e
Compare
gspencergoog
force-pushed
the
palette_generator
branch
from
June 19, 2018 22:40
14f3c9e to
fe34390
Compare
gspencergoog
force-pushed
the
palette_generator
branch
from
June 20, 2018 03:18
fe34390 to
dc6a3af
Compare
Hixie
reviewed
Jul 2, 2018
|
|
||
| //import 'package:palette_generator/palette_generator.dart'; | ||
|
|
||
| //import 'package:flutter/gestures.dart'; |
Hixie
reviewed
Jul 2, 2018
| label: 'Light Muted', color: generator.lightMutedColor?.color), | ||
| new PaletteSwatch(label: 'Muted', color: generator.mutedColor?.color), | ||
| new PaletteSwatch( | ||
| label: 'Dark Muted', color: generator.darkMutedColor?.color), |
Contributor
There was a problem hiding this comment.
having some of these wrapped and some not makes this hard to read
Hixie
reviewed
Jul 2, 2018
|
|
||
| /// Returns a muted and dark color from the palette. Might be null if an | ||
| /// appropriate target color could not be found. | ||
| PaletteColor get darkMutedColor => selectedSwatches[PaletteTarget.darkMuted]; |
Contributor
There was a problem hiding this comment.
ditto with the inconsistent wrapping
Hixie
reviewed
Jul 2, 2018
| hslColor.saturation <= target.maximumSaturation && | ||
| hslColor.lightness >= target.minimumLightness && | ||
| hslColor.lightness <= target.maximumLightness && | ||
| !usedColors.contains(paletteColor.color); |
Hixie
reviewed
Jul 2, 2018
| maximumLightness == other.maximumLightness && | ||
| saturationWeight == other.saturationWeight && | ||
| lightnessWeight == other.lightnessWeight && | ||
| populationWeight == other.populationWeight; |
commented
Jul 2, 2018
Contributor
commented
Jul 6, 2018
Contributor
Author
|
I left the indentation issues because this repo has the dartfmt presubmit check turned on like flutter/plugins does (and so I can't change those without putting in a formatting exception comment). |
…into palette_generator
gspencergoog
force-pushed
the
palette_generator
branch
from
July 6, 2018 19:13
10c9b3e to
561164f
Compare
This was referenced Sep 9, 2025
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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.
Where the first (top left below the image) color is the more prominent distinct color, and the last is the least. It can select various target colors from the available colors based on targets that it is given (and has several default targets it looks for).
The screenshot above is from the sample app that shows how to use it, and lets the user select a region of the image to take the palette from.
[Also, this PR includes the CI PR #1, but I'll merge and resolve that before committing this one.]