Searched refs:swatch (Results 1 - 5 of 5) sorted by relevance

/frameworks/support/v7/palette/src/androidTest/java/android/support/v7/graphics/
H A DSwatchTests.java49 for (Palette.Swatch swatch : p.getSwatches()) {
50 testSwatchTextColorContrasts(swatch);
57 for (Palette.Swatch swatch : p.getSwatches()) {
58 assertNotNull(swatch.getHsl());
65 for (Palette.Swatch swatch : p.getSwatches()) {
66 assertEquals(HSLToColor(swatch.getHsl()), swatch.getRgb());
70 private void testSwatchTextColorContrasts(Palette.Swatch swatch) { argument
71 final int bodyTextColor = swatch.getBodyTextColor();
72 assertTrue(calculateContrast(bodyTextColor, swatch
[all...]
/frameworks/support/v7/palette/src/main/java/android/support/v7/graphics/
H A DDefaultGenerator.java149 for (Swatch swatch : mSwatches) {
150 population = Math.max(population, swatch.getPopulation());
160 for (Swatch swatch : mSwatches) {
161 final float sat = swatch.getHsl()[1];
162 final float luma = swatch.getHsl()[2];
166 !isAlreadySelected(swatch)) {
168 swatch.getPopulation(), mHighestPopulation);
170 max = swatch;
180 * @return true if we have already selected {@code swatch}
182 private boolean isAlreadySelected(Swatch swatch) { argument
[all...]
H A DPalette.java156 * Returns the most vibrant swatch in the palette. Might be null.
164 * Returns a light and vibrant swatch from the palette. Might be null.
172 * Returns a dark and vibrant swatch from the palette. Might be null.
180 * Returns a muted swatch from the palette. Might be null.
188 * Returns a muted and light swatch from the palette. Might be null.
196 * Returns a muted and dark swatch from the palette. Might be null.
206 * @param defaultColor value to return if the swatch isn't available
210 Swatch swatch = getVibrantSwatch();
211 return swatch != null ? swatch
[all...]
H A DColorCutQuantizer.java198 Swatch swatch = vbox.getAverageColor();
199 if (!shouldIgnoreColor(swatch)) {
202 colors.add(swatch);
/frameworks/opt/colorpicker/src/com/android/colorpicker/
H A DColorPickerPalette.java130 * Appends a swatch to the end of the row for even-numbered rows (starting with row 0),
133 private static void addSwatchToRow(TableRow row, View swatch, int rowNumber) { argument
135 row.addView(swatch);
137 row.addView(swatch, 0);
142 * Add a content description to the specified swatch view. Because the colors get added in a
148 View swatch, String[] contentDescriptions) {
169 swatch.setContentDescription(description);
184 * Creates a color swatch.
147 setSwatchDescription(int rowNumber, int index, int rowElements, boolean selected, View swatch, String[] contentDescriptions) argument

Completed in 372 milliseconds