Home | History | Annotate | Download | only in graphics

Lines Matching refs:palette

25 import android.support.v7.graphics.Palette;
39 * Activity which displays the more details about a generated {@link Palette} for a specific
42 * Displays the full generated palette of colors in a grid, which allows clicking on an palette item
45 * Also allows the customization of the number of colors used in the palette generation for
66 mGridView = (GridView) findViewById(R.id.palette);
70 // Set an OnItemClickListener to display a information Toast when a Palette item is clicked
79 final Palette.Swatch item = (Palette.Swatch) adapterView.getItemAtPosition(pos);
129 new Palette.Builder(bitmap).maximumColorCount(numColors).generate(
130 new Palette.PaletteAsyncListener() {
132 public void onGenerated(Palette palette) {
133 populatePalette(palette);
142 private List<Palette.Swatch> mSwatches;
150 public Palette.Swatch getItem(int position) {
159 void setSwatches(List<Palette.Swatch> palette) {
160 mSwatches = palette;
174 private void populatePalette(Palette palette) {
175 mSwatchesPalette.setSwatches(palette.getSwatches());
177 setBackgroundColor(findViewById(R.id.text_vibrant), palette.getVibrantSwatch());
178 setBackgroundColor(findViewById(R.id.text_muted), palette.getMutedSwatch());
179 setBackgroundColor(findViewById(R.id.text_light_vibrant), palette.getLightVibrantSwatch());
180 setBackgroundColor(findViewById(R.id.text_light_muted), palette.getLightMutedSwatch());
181 setBackgroundColor(findViewById(R.id.text_dark_vibrant), palette.getDarkVibrantSwatch());
182 setBackgroundColor(findViewById(R.id.text_dark_muted), palette.getDarkMutedSwatch());
185 private void setBackgroundColor(View view, Palette.Swatch swatch) {