Home
last modified time | relevance | path

Searched refs:colors (Results 1 – 25 of 103) sorted by relevance

12345

/frameworks/base/packages/EasterEgg/src/com/android/egg/paint/
DPalette.kt22 var colors : IntArray variable in com.android.egg.paint.Palette
40 val count = colors.size in randomize()
41 colors[0] = Color.HSVToColor(hsv) in randomize()
48 colors[i] = color in randomize()
50 val lum = lum(colors[i]) in randomize()
51 if (lum < lum(colors[darkest])) darkest = i in randomize()
52 if (lum > lum(colors[lightest])) lightest = i in randomize()
58 for (c in colors) { in toString()
66 colors = IntArray(count)
71 colors = IntArray(count)
[all …]
DPaintActivity.java56 private LinearLayout colors = null; field in PaintActivity
66 hideToolbar(colors);
72 toggleToolbar(colors);
149 colors = findViewById(R.id.colors); in setupViews()
198 colors.removeAllViews(); in setupViews()
199 showToolbar(colors); in setupViews()
255 if (colors.getChildCount() == 0) { in refreshBrushAndColor()
271 colors.setSelected(false); in refreshBrushAndColor()
272 hideToolbar(colors); in refreshBrushAndColor()
277 colors.addView(button, button_lp); in refreshBrushAndColor()
/frameworks/base/tests/HwAccelerationTest/src/com/android/test/hwui/
DGradientStopsActivity.java45 int[] colors = new int[] { 0xffff0000, 0xff0000ff }; in onDraw() local
48 colors, positions, Shader.TileMode.CLAMP); in onDraw()
55 colors = new int[] { 0xffff0000, 0xff0000ff, 0xff00ff00 }; in onDraw()
58 colors, positions, Shader.TileMode.CLAMP); in onDraw()
65 colors = new int[] { 0xffff0000, 0xff0000ff, 0xff00ff00 }; in onDraw()
68 colors, positions, Shader.TileMode.CLAMP); in onDraw()
75 colors = new int[] { 0xff000000, 0xffffffff }; in onDraw()
77 colors, null, Shader.TileMode.CLAMP); in onDraw()
85 colors, null, Shader.TileMode.REPEAT); in onDraw()
93 colors, null, Shader.TileMode.MIRROR); in onDraw()
[all …]
/frameworks/base/graphics/java/android/graphics/
DShader.java188 public static @ColorLong long[] convertColors(@NonNull @ColorInt int[] colors) { in convertColors() argument
189 if (colors.length < 2) { in convertColors()
193 long[] colorLongs = new long[colors.length]; in convertColors()
194 for (int i = 0; i < colors.length; ++i) { in convertColors()
195 colorLongs[i] = Color.pack(colors[i]); in convertColors()
209 public static ColorSpace detectColorSpace(@NonNull @ColorLong long[] colors) { in detectColorSpace() argument
210 if (colors.length < 2) { in detectColorSpace()
213 final ColorSpace colorSpace = Color.colorSpace(colors[0]); in detectColorSpace()
214 for (int i = 1; i < colors.length; ++i) { in detectColorSpace()
215 if (Color.colorSpace(colors[i]) != colorSpace) { in detectColorSpace()
DSweepGradient.java61 public SweepGradient(float cx, float cy, @NonNull @ColorInt int[] colors, in SweepGradient() argument
63 this(cx, cy, convertColors(colors), positions, ColorSpace.get(ColorSpace.Named.SRGB)); in SweepGradient()
83 public SweepGradient(float cx, float cy, @NonNull @ColorLong long[] colors, in SweepGradient() argument
85 this(cx, cy, colors.clone(), positions, detectColorSpace(colors)); in SweepGradient()
92 private SweepGradient(float cx, float cy, @NonNull @ColorLong long[] colors, in SweepGradient() argument
96 if (positions != null && colors.length != positions.length) { in SweepGradient()
102 mColorLongs = colors; in SweepGradient()
140 long[] colors, float[] positions, long colorSpaceHandle); in nativeCreate() argument
DRadialGradient.java65 @NonNull @ColorInt int[] colors, @Nullable float[] stops, in RadialGradient() argument
67 this(centerX, centerY, radius, convertColors(colors), stops, tileMode, in RadialGradient()
89 @NonNull @ColorLong long[] colors, @Nullable float[] stops, in RadialGradient() argument
91 this(centerX, centerY, radius, colors.clone(), stops, tileMode, detectColorSpace(colors)); in RadialGradient()
99 @NonNull @ColorLong long[] colors, @Nullable float[] stops, in RadialGradient() argument
106 if (stops != null && colors.length != stops.length) { in RadialGradient()
112 mColorLongs = colors; in RadialGradient()
158 @ColorLong long[] colors, float[] positions, int tileMode, long colorSpaceHandle); in nativeCreate() argument
DLinearGradient.java68 public LinearGradient(float x0, float y0, float x1, float y1, @NonNull @ColorInt int[] colors, in LinearGradient() argument
70 this(x0, y0, x1, y1, convertColors(colors), positions, tile, in LinearGradient()
91 public LinearGradient(float x0, float y0, float x1, float y1, @NonNull @ColorLong long[] colors, in LinearGradient() argument
93 this(x0, y0, x1, y1, colors.clone(), positions, tile, detectColorSpace(colors)); in LinearGradient()
101 @NonNull @ColorLong long[] colors, @Nullable float[] positions, @NonNull TileMode tile, in LinearGradient() argument
105 if (positions != null && colors.length != positions.length) { in LinearGradient()
112 mColorLongs = colors; in LinearGradient()
162 long[] colors, float[] positions, int tileMode, long colorSpaceHandle); in nativeCreate() argument
/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/clock/
DClockPaletteTest.kt33 private lateinit var colors: IntArray variable in com.android.keyguard.clock.ClockPaletteTest
41 colors = IntArray(10) in setUp()
42 val step: Float = (0f - hsv[2]) / colors.size in setUp()
43 for (i in 0 until colors.size) { in setUp()
45 colors[i] = Color.HSVToColor(hsv) in setUp()
54 clockPalette.setColorPalette(false, colors) in testDark()
65 clockPalette.setColorPalette(true, colors) in testDarkText()
76 clockPalette.setColorPalette(false, colors) in testLightText()
/frameworks/layoutlib/bridge/src/android/graphics/
DGradient_Delegate.java52 protected Gradient_Delegate(long nativeMatrix, long[] colors, float[] positions) { in Gradient_Delegate() argument
54 assert colors.length >= 2 : "needs >= 2 number of colors"; in Gradient_Delegate()
57 float spacing = 1.f / (colors.length - 1); in Gradient_Delegate()
58 positions = new float[colors.length]; in Gradient_Delegate()
60 positions[colors.length - 1] = 1.f; in Gradient_Delegate()
61 for (int i = 1; i < colors.length - 1; i++) { in Gradient_Delegate()
65 assert colors.length == positions.length : in Gradient_Delegate()
73 mColors = Arrays.stream(colors).mapToInt(Color::toArgb).toArray(); in Gradient_Delegate()
90 protected GradientPaint(int[] colors, float[] positions, TileMode tileMode) { in GradientPaint() argument
91 mColors = colors; in GradientPaint()
DSweepGradient_Delegate.java59 /*package*/ static long nativeCreate(long matrix, float x, float y, long[] colors, in nativeCreate() argument
61 SweepGradient_Delegate newDelegate = new SweepGradient_Delegate(matrix, x, y, colors, in nativeCreate()
84 long[] colors, float[] positions) { in SweepGradient_Delegate() argument
85 super(nativeMatrix, colors, positions); in SweepGradient_Delegate()
94 public SweepGradientPaint(float cx, float cy, int[] colors, in SweepGradientPaint() argument
96 super(colors, positions, null /*tileMode*/); in SweepGradientPaint()
DRadialGradient_Delegate.java63 long[] colors, float[] positions, int tileMode, long colorSpaceHandle) { in nativeCreate() argument
65 colors, positions, Shader_Delegate.getTileMode(tileMode)); in nativeCreate()
87 long[] colors, float[] positions, TileMode tile) { in RadialGradient_Delegate() argument
88 super(nativeMatrix, colors, positions); in RadialGradient_Delegate()
99 int[] colors, float[] positions, TileMode mode) { in RadialGradientPaint() argument
100 super(colors, positions, mode); in RadialGradientPaint()
/frameworks/opt/colorpicker/src/com/android/colorpicker/
DColorPickerDialog.java64 public static ColorPickerDialog newInstance(int titleResId, int[] colors, int selectedColor, in newInstance() argument
67 ret.initialize(titleResId, colors, selectedColor, columns, size); in newInstance()
71 public void initialize(int titleResId, int[] colors, int selectedColor, int columns, int size) { in initialize() argument
73 setColors(colors, selectedColor); in initialize()
163 public void setColors(int[] colors, int selectedColor) { in setColors() argument
164 if (mColors != colors || mSelectedColor != selectedColor) { in setColors()
165 mColors = colors; in setColors()
171 public void setColors(int[] colors) { in setColors() argument
172 if (mColors != colors) { in setColors()
173 mColors = colors; in setColors()
DColorPickerPalette.java84 public void drawPalette(int[] colors, int selectedColor) { in drawPalette() argument
85 drawPalette(colors, selectedColor, null); in drawPalette()
91 public void drawPalette(int[] colors, int selectedColor, String[] colorContentDescriptions) { in drawPalette() argument
92 if (colors == null) { in drawPalette()
103 for (int color : colors) { in drawPalette()
/frameworks/base/tests/Internal/src/android/app/
DWallpaperColorsTest.java39 WallpaperColors colors = new WallpaperColors(color, null, null, 0); in supportsDarkTextOverrideTest() local
41 (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT) == 0); in supportsDarkTextOverrideTest()
44 colors = new WallpaperColors(color, null, null, WallpaperColors.HINT_SUPPORTS_DARK_TEXT); in supportsDarkTextOverrideTest()
46 (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT) == 0); in supportsDarkTextOverrideTest()
84 WallpaperColors colors = new WallpaperColors(Color.valueOf(Color.GREEN), null, null); in colorHintsTest() local
85 fromBitmap = (colors.getColorHints() & WallpaperColors.HINT_FROM_BITMAP) != 0; in colorHintsTest()
93 WallpaperColors colors = new WallpaperColors(color, null, null); in darkMainColorSupportsDarkTheme() local
95 (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_THEME) != 0); in darkMainColorSupportsDarkTheme()
/frameworks/base/libs/hwui/
DNinePatchUtils.h57 int numFlags, const Res_png_9patch& chunk, SkColor* colors) { in SetLatticeFlags() argument
59 lattice->fColors = colors; in SetLatticeFlags()
61 sk_bzero(colors, numFlags * sizeof(SkColor)); in SetLatticeFlags()
70 colors += lattice->fXCount + 1; in SetLatticeFlags()
81 colors++; in SetLatticeFlags()
91 *colors = currentColor; in SetLatticeFlags()
96 colors++; in SetLatticeFlags()
/frameworks/base/core/java/com/android/internal/graphics/palette/
DColorCutQuantizer.java126 final int[] colors = mColors = new int[distinctColorCount]; in quantize() local
130 colors[distinctColorIndex++] = color; in quantize()
141 for (int color : colors) { in quantize()
216 ArrayList<Swatch> colors = new ArrayList<>(vboxes.size()); in generateAverageColors() local
222 colors.add(swatch); in generateAverageColors()
225 return colors; in generateAverageColors()
265 final int[] colors = mColors; in fitBox() local
276 final int color = colors[i]; in fitBox()
361 final int[] colors = mColors; in findSplitPoint() local
367 modifySignificantOctet(colors, longestDimension, mLowerIndex, mUpperIndex); in findSplitPoint()
[all …]
/frameworks/layoutlib/bridge/src/android/view/
DRectShadowPainter.java79 int[] colors = {START_COLOR, START_COLOR, END_COLOR}; in paintShadow() local
82 for (int i = 0; i < colors.length; i++) { in paintShadow()
83colors[i] = Color.argb((int) (Color.alpha(colors[i]) * alpha), Color.red(colors[i]), in paintShadow()
84 Color.green(colors[i]), Color.blue(colors[i])); in paintShadow()
87 cornerPaint.setShader(new RadialGradient(0, 0, outerArcRadius, colors, in paintShadow()
89 edgePaint.setShader(new LinearGradient(0, 0, -shadowSize, 0, colors[0], colors[2], in paintShadow()
116 colors, new float[]{0f, 1 / 3f, 1f}, TileMode.CLAMP)); in paintShadow()
/frameworks/base/libs/hwui/jni/
DShader.cpp94 std::vector<SkColor4f> colors(count); in convertColorLongs() local
96 colors[i] = GraphicsJNI::convertColorLong(colorValues[i]); in convertColorLongs()
100 return colors; in convertColorLongs()
112 std::vector<SkColor4f> colors = convertColorLongs(env, colorArray); in LinearGradient_create() local
114 AutoJavaFloatArray autoPos(env, posArray, colors.size()); in LinearGradient_create()
121 sk_sp<SkShader> shader(SkGradientShader::MakeLinear(pts, &colors[0], in LinearGradient_create()
122 GraphicsJNI::getNativeColorSpace(colorSpaceHandle), pos, colors.size(), in LinearGradient_create()
142 std::vector<SkColor4f> colors = convertColorLongs(env, colorArray); in RadialGradient_create() local
144 AutoJavaFloatArray autoPos(env, posArray, colors.size()); in RadialGradient_create()
151 sk_sp<SkShader> shader = SkGradientShader::MakeRadial(center, radius, &colors[0], in RadialGradient_create()
[all …]
/frameworks/base/core/tests/coretests/src/android/graphics/
DBitmapTest.java87 int[] colors = new int[100]; in testGetPixelsWithAlpha() local
89 colors[i] = (0xFF << 24) | (i << 16) | (i << 8) | i; in testGetPixelsWithAlpha()
92 Bitmap bm = Bitmap.createBitmap(colors, 10, 10, in testGetPixelsWithAlpha()
104 assertEquals("getPixel", p, colors[i]); in testGetPixelsWithAlpha()
113 int[] colors = new int[100]; in testGetPixelsWithoutAlpha() local
115 colors[i] = (0xFF << 24) | (i << 16) | (i << 8) | i; in testGetPixelsWithoutAlpha()
118 Bitmap bm = Bitmap.createBitmap(colors, 10, 10, Bitmap.Config.RGB_565); in testGetPixelsWithoutAlpha()
130 int[] colors = new int[100]; in testSetPixelsWithAlpha() local
132 colors[i] = (0xFF << 24) | (i << 16) | (i << 8) | i; in testSetPixelsWithAlpha()
136 Bitmap bm1 = Bitmap.createBitmap(colors, 10, 10, config); in testSetPixelsWithAlpha()
[all …]
/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/system/
DTonalCompat.java32 public ExtractionInfo extractDarkColors(WallpaperColors colors) { in extractDarkColors() argument
34 mTonal.extractInto(colors, new GradientColors(), darkColors, new GradientColors()); in extractDarkColors()
40 if (colors != null) { in extractDarkColors()
42 (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_THEME) != 0; in extractDarkColors()
/frameworks/base/tests/Internal/src/com/android/internal/colorextraction/
DColorExtractorTest.java91 GradientColors colors = extractor.getColors(WallpaperManager.FLAG_SYSTEM, in getColors_usesExtractedColors() local
93 assertEquals("Extracted colors not being used!", colors, colorsExpectedNormal); in getColors_usesExtractedColors()
94 colors = extractor.getColors(WallpaperManager.FLAG_SYSTEM, ColorExtractor.TYPE_DARK); in getColors_usesExtractedColors()
95 assertEquals("Extracted colors not being used!", colors, colorsExpectedDark); in getColors_usesExtractedColors()
96 colors = extractor.getColors(WallpaperManager.FLAG_SYSTEM, ColorExtractor.TYPE_EXTRA_DARK); in getColors_usesExtractedColors()
97 assertEquals("Extracted colors not being used!", colors, colorsExpectedExtraDark); in getColors_usesExtractedColors()
/frameworks/base/core/java/com/android/internal/colorextraction/
DColorExtractor.java68 GradientColors[] colors = new GradientColors[sGradientTypes.length]; in ColorExtractor() local
69 mGradientColors.append(which, colors); in ColorExtractor()
71 colors[type] = new GradientColors(); in ColorExtractor()
172 public void onColorsChanged(WallpaperColors colors, int which) { in onColorsChanged() argument
174 Log.d(TAG, "New wallpaper colors for " + which + ": " + colors); in onColorsChanged()
178 mLockColors = colors; in onColorsChanged()
180 extractInto(colors, lockColors[TYPE_NORMAL], lockColors[TYPE_DARK], in onColorsChanged()
185 mSystemColors = colors; in onColorsChanged()
187 extractInto(colors, systemColors[TYPE_NORMAL], systemColors[TYPE_DARK], in onColorsChanged()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DScrimView.java102 public void setColors(@NonNull ColorExtractor.GradientColors colors) { in setColors() argument
103 setColors(colors, false); in setColors()
106 public void setColors(@NonNull ColorExtractor.GradientColors colors, boolean animated) { in setColors() argument
107 if (colors == null) { in setColors()
110 if (mColors.equals(colors)) { in setColors()
113 mColors.set(colors); in setColors()
/frameworks/base/libs/hwui/tests/common/scenes/
DHwBitmapInCompositeShader.cpp59 SkColor colors[2]; in createContent() local
60 colors[0] = Color::Black; in createContent()
61 colors[1] = Color::White; in createContent()
63 center, 50, colors, nullptr, 2, SkTileMode::kRepeat); in createContent()
/frameworks/base/core/java/android/content/res/
DColorStateList.java158 public ColorStateList(int[][] states, @ColorInt int[] colors) { in ColorStateList() argument
160 mColors = colors; in ColorStateList()
293 final int[] colors = new int[mColors.length]; in withAlpha() local
294 final int len = colors.length; in withAlpha()
296 colors[i] = (mColors[i] & 0xFFFFFF) | (alpha << 24); in withAlpha()
299 return new ColorStateList(mStateSpecs, colors); in withAlpha()
652 final int[] colors = mColors; in onColorsChanged() local
655 defaultColor = colors[0]; in onColorsChanged()
659 defaultColor = colors[i]; in onColorsChanged()
665 if (Color.alpha(colors[i]) != 0xFF) { in onColorsChanged()
[all …]

12345