Home
last modified time | relevance | path

Searched refs:Color (Results 1 – 25 of 400) sorted by relevance

12345678910>>...16

/cts/tests/app/WallpaperTest/src/android/app/cts/wallpapers/
DWallpaperColorsTest.java22 import android.graphics.Color;
42 ArrayList<Color> colorList = new ArrayList<>(); in getWallpaperColorsTest()
43 colorList.add(Color.valueOf(Color.WHITE)); in getWallpaperColorsTest()
44 colorList.add(Color.valueOf(Color.BLACK)); in getWallpaperColorsTest()
45 colorList.add(Color.valueOf(Color.GREEN)); in getWallpaperColorsTest()
56 WallpaperColors colors1 = new WallpaperColors(Color.valueOf(Color.BLACK), null, null); in equalsTest()
57 WallpaperColors colors2 = new WallpaperColors(Color.valueOf(Color.WHITE), null, null); in equalsTest()
63 WallpaperColors colors3 = new WallpaperColors(Color.valueOf(Color.BLACK), null, null); in equalsTest()
69 WallpaperColors wallpaperColors = new WallpaperColors(Color.valueOf(Color.WHITE), in parcelTest()
70 Color.valueOf(Color.BLACK), Color.valueOf(Color.GREEN)); in parcelTest()
[all …]
/cts/tests/tests/graphics/src/android/graphics/cts/
DLightingColorFilterTest.java22 import android.graphics.Color;
50 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
51 paint.setColorFilter(new LightingColorFilter(Color.WHITE, Color.BLACK)); in testLightingColorFilter()
53 verifyColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
55 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
56 paint.setColorFilter(new LightingColorFilter(Color.CYAN, Color.BLACK)); in testLightingColorFilter()
58 verifyColor(Color.BLUE, bitmap.getPixel(0, 0)); in testLightingColorFilter()
60 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
61 paint.setColorFilter(new LightingColorFilter(Color.BLUE, Color.GREEN)); in testLightingColorFilter()
63 verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
[all …]
DLinearGradientTest.java25 import android.graphics.Color;
49 int[] color = { Color.BLUE, Color.GREEN, Color.RED }; in testLinearGradient()
58 assertTrue(Color.blue(b.getPixel(10, 0)) > Color.blue(b.getPixel(10, 5))); in testLinearGradient()
59 assertTrue(Color.blue(b.getPixel(10, 5)) > Color.blue(b.getPixel(10, 10))); in testLinearGradient()
60 assertTrue(Color.green(b.getPixel(10, 0)) < Color.green(b.getPixel(10, 5))); in testLinearGradient()
61 assertTrue(Color.green(b.getPixel(10, 5)) < Color.green(b.getPixel(10, 10))); in testLinearGradient()
63 assertTrue(Color.green(b.getPixel(10, 15)) > Color.green(b.getPixel(10, 20))); in testLinearGradient()
64 assertTrue(Color.green(b.getPixel(10, 20)) > Color.green(b.getPixel(10, 25))); in testLinearGradient()
65 assertTrue(Color.red(b.getPixel(10, 15)) < Color.red(b.getPixel(10, 20))); in testLinearGradient()
66 assertTrue(Color.red(b.getPixel(10, 20)) < Color.red(b.getPixel(10, 25))); in testLinearGradient()
[all …]
DSweepGradientTest.java25 import android.graphics.Color;
62 mBitmap.eraseColor(Color.TRANSPARENT); in setup()
68 final int[] colors = new int[] { Color.GREEN, Color.RED }; in test2Colors()
78 final int[] colors = new int[] { Color.GREEN, Color.RED, Color.BLUE }; in testColorArray()
89 final int[] colors = new int[] { Color.GREEN, Color.RED, Color.BLUE, Color.GREEN }; in testMultiColor()
127 int alpha = (int) ((1d - delta) * Color.alpha(colors[i1]) + in verifyColors()
128 delta * Color.alpha(colors[i2])); in verifyColors()
129 int red = (int) ((1d - delta) * Color.red(colors[i1]) + in verifyColors()
130 delta * Color.red(colors[i2])); in verifyColors()
131 int green = (int) ((1d - delta) * Color.green(colors[i1]) + in verifyColors()
[all …]
DRadialGradientTest.java24 import android.graphics.Color;
49 Color.RED, Color.BLUE, TileMode.CLAMP); in testZeroScaleMatrix()
56 bitmap.eraseColor(Color.BLACK); in testZeroScaleMatrix()
63 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(0, 0), 1); in testZeroScaleMatrix()
64 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(1, 0), 1); in testZeroScaleMatrix()
65 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(2, 0), 1); in testZeroScaleMatrix()
71 long red = Color.pack(1, 0, 0, 1, p3); in testColorLong()
72 long blue = Color.pack(0, 0, 1, 1, p3); in testColorLong()
76 bitmap.eraseColor(Color.TRANSPARENT); in testColorLong()
84 Function<Long, Color> convert = (l) -> { in testColorLong()
[all …]
DColorTest.java24 import android.graphics.Color;
361 assertEquals(0xff, Color.alpha(Color.RED)); in testAlpha()
362 assertEquals(0xff, Color.alpha(Color.YELLOW)); in testAlpha()
367 assertEquals(Color.RED, Color.argb(0xff, 0xff, 0x00, 0x00)); in testArgb()
368 assertEquals(Color.YELLOW, Color.argb(0xff, 0xff, 0xff, 0x00)); in testArgb()
369 assertEquals(Color.RED, Color.argb(1.0f, 1.0f, 0.0f, 0.0f)); in testArgb()
370 assertEquals(Color.YELLOW, Color.argb(1.0f, 1.0f, 1.0f, 0.0f)); in testArgb()
375 assertEquals(0x00, Color.blue(Color.RED)); in testBlue()
376 assertEquals(0x00, Color.blue(Color.YELLOW)); in testBlue()
381 assertEquals(0x00, Color.green(Color.RED)); in testGreen()
[all …]
DComposeShaderTest.java25 import android.graphics.Color;
51 Color.GREEN, Color.BLUE, Shader.TileMode.CLAMP); in testPorterDuff()
53 Color.GREEN, Color.RED, Shader.TileMode.CLAMP); in testPorterDuff()
69 assertEquals(0xFF, Color.alpha(pixel), TOLERANCE); in testPorterDuff()
70 assertEquals(y, Color.red(pixel), TOLERANCE); in testPorterDuff()
71 assertEquals(green, Color.green(pixel), TOLERANCE); in testPorterDuff()
72 assertEquals(x, Color.blue(pixel), TOLERANCE); in testPorterDuff()
84 Color.GREEN, Color.BLUE, Shader.TileMode.CLAMP); in testBlendMode()
86 Color.GREEN, Color.RED, Shader.TileMode.CLAMP); in testBlendMode()
102 assertEquals(0xFF, Color.alpha(pixel), TOLERANCE); in testBlendMode()
[all …]
DPorterDuffColorFilterTest.java23 import android.graphics.Color;
44 b1.eraseColor(Color.RED); in testPorterDuffColorFilter()
46 b2.eraseColor(Color.BLUE); in testPorterDuffColorFilter()
49 target.eraseColor(Color.TRANSPARENT); in testPorterDuffColorFilter()
52 int filterColor = Color.argb(0x80, 0, 0xFF, 0); in testPorterDuffColorFilter()
58 assertEquals(Color.RED, target.getPixel(width / 4, height / 4)); in testPorterDuffColorFilter()
60 assertEquals(0x80, Color.red(lowerLeft), TOLERANCE); in testPorterDuffColorFilter()
61 assertEquals(0x80, Color.green(lowerLeft), TOLERANCE); in testPorterDuffColorFilter()
65 target.eraseColor(Color.BLACK); in testPorterDuffColorFilter()
71 assertEquals(Color.RED, target.getPixel(width / 4, height / 4)); in testPorterDuffColorFilter()
[all …]
DColorMatrixColorFilterTest.java24 import android.graphics.Color;
56 paint.setColor(Color.BLUE); in testColorMatrixColorFilter()
60 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
61 paint.setColor(Color.GREEN); in testColorMatrixColorFilter()
63 ColorUtils.verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
64 paint.setColor(Color.RED); in testColorMatrixColorFilter()
66 ColorUtils.verifyColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
68 paint.setColor(Color.MAGENTA); in testColorMatrixColorFilter()
70 ColorUtils.verifyColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
80 paint.setColor(Color.RED); in testColorMatrixColorFilter()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DGradientTests.java23 import android.graphics.Color;
52 paint.setColor(Color.RED); in testAlphaPreMultiplication()
55 paint.setColor(Color.WHITE); in testAlphaPreMultiplication()
89 new long[] { Color.pack(Color.RED), Color.pack(Color.CYAN) }, in testRadialGradientWithFocalPoint()
107 Color.CYAN, Color.CYAN, Color.CYAN, Color.CYAN, Color.RED in testRadialGradientWithFocalPoint()
129 new long[] { Color.pack(Color.RED), Color.pack(Color.CYAN) }, in testRadialGradientSameStartEndCircles()
151 Color.CYAN, in testRadialGradientSameStartEndCircles()
152 Color.CYAN, in testRadialGradientSameStartEndCircles()
153 Color.CYAN, in testRadialGradientSameStartEndCircles()
154 Color.CYAN, in testRadialGradientSameStartEndCircles()
[all …]
DBlendModeTest.java22 import android.graphics.Color;
39 private static final int BG_COLOR = Color.WHITE;
40 private static final int DST_COLOR = Color.RED;
41 private static final int SRC_COLOR = Color.BLUE;
63 canvas.drawColor(Color.WHITE); in draw()
115 testBlendMode(BlendMode.CLEAR, Color.WHITE, Color.WHITE, Color.WHITE); in testBlendMode_CLEAR()
135 testBlendMode(BlendMode.DST_OVER, Color.RED, Color.RED, Color.BLUE); in testBlendMode_DST_OVER()
140 testBlendMode(BlendMode.SRC_IN, BG_COLOR, Color.BLUE, BG_COLOR); in testBlendMode_SRC_IN()
150 testBlendMode(BlendMode.SRC_OUT, BG_COLOR, BG_COLOR, Color.BLUE); in testBlendMode_SRC_OUT()
160 testBlendMode(BlendMode.SRC_ATOP, DST_COLOR, Color.BLUE, BG_COLOR); in testBlendMode_SRC_ATOP()
[all …]
DBitmapFilterTests.java19 import android.graphics.Color;
55 int weight = Color.red(color) + Color.blue(color) + Color.green(color);
62 = new ColorVerifier(Color.argb(255, 127, 127, 127),
66 = new ColorVerifier(Color.argb(255, 127, 127, 127),
74 bitmap.setPixel(i, j, isWhite ? Color.WHITE : Color.BLACK); in createGridBitmap()
151 Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE,
152 Color.WHITE, Color.BLACK, Color.BLACK, Color.BLACK, Color.WHITE,
153 Color.WHITE, Color.BLACK, Color.BLACK, Color.BLACK, Color.WHITE,
154 Color.WHITE, Color.BLACK, Color.BLACK, Color.BLACK, Color.WHITE,
155 Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE},
[all …]
DBitmapBlendModeTest.java19 import android.graphics.Color;
50 int[] colors = {Color.RED, Color.RED, Color.RED, Color.RED, Color.RED}; in testClearBlendMode()
53 Color.BLUE, Color.RED); in testClearBlendMode()
64 int[] colors = {Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE, Color.RED}; in testDstOutBlendMode()
67 Color.BLUE, Color.RED); in testDstOutBlendMode()
DExactCanvasTests.java21 import android.graphics.Color;
70 p.setColor(Color.BLUE); in testBlueRect()
73 .runWithVerifier(new RectVerifier(Color.WHITE, Color.BLUE, rect)); in testBlueRect()
83 p.setColor(Color.BLACK); in testPoints()
97 p.setColor(Color.RED); in testBlackRectWithStroke()
100 p.setColor(Color.BLACK); in testBlackRectWithStroke()
111 canvas.drawColor(Color.GREEN); in testBlackLineOnGreenBack()
113 p.setColor(Color.BLACK); in testBlackLineOnGreenBack()
124 canvas.drawColor(Color.BLUE); in testDrawRedRectOnBlueBack()
126 p.setColor(Color.RED); in testDrawRedRectOnBlueBack()
[all …]
DShadowTests.java24 import android.graphics.Color;
56 Color.WHITE, in createVerifier()
57 Color.WHITE, in createVerifier()
105 if (color == Color.WHITE) return true; in testRedSpotShadow()
106 return Color.red(color) > Color.green(color) in testRedSpotShadow()
107 && Color.red(color) > Color.blue(color); in testRedSpotShadow()
112 view.findViewById(R.id.shadow_view).setOutlineSpotShadowColor(Color.RED); in testRedSpotShadow()
121 if (color == Color.WHITE) return true; in testRedAmbientShadow()
122 return Color.red(color) > Color.green(color) in testRedAmbientShadow()
123 && Color.red(color) > Color.blue(color); in testRedAmbientShadow()
[all …]
DBlendModeColorFilterTest.java24 import android.graphics.Color;
47 private static final int FILTER_COLOR = Color.argb(0x80, 0, 0xFF, 0);
65 b1.eraseColor(Color.RED); in BlendModeColorFilterClient()
68 b2.eraseColor(Color.BLUE); in BlendModeColorFilterClient()
77 canvas.drawColor(Color.WHITE); in draw()
95 new int[]{Color.RED, 0xFF7F8000, 0xFF7FFF7f}); in testBlendModeColorFilter_SRC()
101 new int[]{Color.RED, Color.BLUE, Color.BLUE}); in testBlendModeColorFilter_DST()
106 testBlendModeColorFilter(Color.GREEN, BlendMode.SCREEN, in testBlendModeColorFilter_SCREEN()
107 new int[]{Color.RED, Color.CYAN, Color.CYAN}); in testBlendModeColorFilter_SCREEN()
112 BlendModeColorFilter filter = new BlendModeColorFilter(Color.CYAN, BlendMode.SOFT_LIGHT); in testBlendModeColorFilterGetMode()
[all …]
/cts/tests/tests/view/src/android/view/cts/
DViewOverlayTest.java22 import android.graphics.Color;
73 Color.WHITE, null); in testBasics()
93 final Drawable redDrawable = new ColorDrawable(Color.RED); in testOverlayWithOneDrawable()
98 colorRectangles.add(new Pair<>(new Rect(20, 30, 40, 50), Color.RED)); in testOverlayWithOneDrawable()
100 Color.WHITE, colorRectangles); in testOverlayWithOneDrawable()
105 Color.WHITE, null); in testOverlayWithOneDrawable()
111 final Drawable redDrawable = new ColorDrawable(Color.RED); in testAddTheSameDrawableTwice()
118 colorRectangles.add(new Pair<>(new Rect(20, 30, 40, 50), Color.RED)); in testAddTheSameDrawableTwice()
120 Color.WHITE, colorRectangles); in testAddTheSameDrawableTwice()
125 Color.WHITE, null); in testAddTheSameDrawableTwice()
[all …]
DViewGroupOverlayTest.java30 import android.graphics.Color;
93 Color.WHITE, null); in testBasics()
114 redView.setBackgroundColor(Color.RED); in testOverlayWithOneView()
120 colorRectangles.add(new Pair<>(new Rect(10, 20, 30, 40), Color.RED)); in testOverlayWithOneView()
122 mViewGroupWithOverlay, Color.WHITE, colorRectangles); in testOverlayWithOneView()
127 Color.WHITE, null); in testOverlayWithOneView()
135 redView.setBackgroundColor(Color.RED); in testOverlayWithNonOverlappingViews()
138 greenView.setBackgroundColor(Color.GREEN); in testOverlayWithNonOverlappingViews()
141 blueView.setBackgroundColor(Color.BLUE); in testOverlayWithNonOverlappingViews()
149 colorRectangles.add(new Pair<>(new Rect(10, 20, 30, 40), Color.RED)); in testOverlayWithNonOverlappingViews()
[all …]
DPixelCopyTest.java39 import android.graphics.Color;
247 Color.RED, Color.GREEN, Color.BLUE, Color.BLACK); in testGlProducerFullsize()
260 Color.RED, Color.GREEN, Color.BLUE, Color.BLACK); in testGlProducerAutoSize()
270 Color.RED, Color.RED, Color.RED, Color.RED); in testGlProducerCropTopLeft()
280 Color.RED, Color.GREEN, Color.BLUE, Color.BLACK); in testGlProducerCropCenter()
290 Color.BLUE, Color.BLACK, Color.BLUE, Color.BLACK); in testGlProducerCropBottomHalf()
300 Color.GREEN, Color.GREEN, Color.GREEN, Color.GREEN); in testGlProducerCropClamping()
316 Color.RED, Color.GREEN, Color.BLUE, Color.BLACK); in testGlProducerScaling()
332 Color.RED, Color.GREEN, Color.BLUE, Color.BLACK); in testReuseBitmap()
333 bitmap.eraseColor(Color.MAGENTA); in testReuseBitmap()
[all …]
/cts/tests/tests/uirendering27/src/android/uirendering/cts/util/
DCompareUtils.java3 import android.graphics.Color;
10 int diff = Math.abs(Color.red(color) - Color.red(expectedColor)) in verifyPixelWithThreshold()
11 + Math.abs(Color.green(color) - Color.green(expectedColor)) in verifyPixelWithThreshold()
12 + Math.abs(Color.blue(color) - Color.blue(expectedColor)); in verifyPixelWithThreshold()
22 int average = Color.red(color) + Color.green(color) + Color.blue(color); in verifyPixelGrayScale()
24 return Math.abs(Color.red(color) - average) <= threshold in verifyPixelGrayScale()
25 && Math.abs(Color.green(color) - average) <= threshold in verifyPixelGrayScale()
26 && Math.abs(Color.blue(color) - average) <= threshold; in verifyPixelGrayScale()
/cts/tests/tests/uirendering/src/android/uirendering/cts/util/
DCompareUtils.java3 import android.graphics.Color;
10 int diff = Math.abs(Color.red(color) - Color.red(expectedColor)) in verifyPixelWithThreshold()
11 + Math.abs(Color.green(color) - Color.green(expectedColor)) in verifyPixelWithThreshold()
12 + Math.abs(Color.blue(color) - Color.blue(expectedColor)); in verifyPixelWithThreshold()
22 int average = Color.red(color) + Color.green(color) + Color.blue(color); in verifyPixelGrayScale()
24 return Math.abs(Color.red(color) - average) <= threshold in verifyPixelGrayScale()
25 && Math.abs(Color.green(color) - average) <= threshold in verifyPixelGrayScale()
26 && Math.abs(Color.blue(color) - average) <= threshold; in verifyPixelGrayScale()
/cts/tests/tests/uirendering27/src/android/uirendering/cts/testclasses/
DBitmapBlendModeTest.java19 import android.graphics.Color;
51 int[] colors = {Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE, Color.RED}; in testClearBlendMode()
54 Color.BLUE, Color.RED); in testClearBlendMode()
65 int[] colors = {Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE, Color.RED}; in testDstOutBlendMode()
68 Color.BLUE, Color.RED); in testDstOutBlendMode()
/cts/tests/tests/text/src/android/text/style/cts/
DBackgroundColorSpanTest.java21 import android.graphics.Color;
37 BackgroundColorSpan b = new BackgroundColorSpan(Color.GREEN); in testConstructor()
51 BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.BLACK); in testUpdateDrawState()
55 assertEquals(Color.BLACK, tp.bgColor); in testUpdateDrawState()
57 backgroundColorSpan = new BackgroundColorSpan(Color.BLUE); in testUpdateDrawState()
59 assertEquals(Color.BLUE, tp.bgColor); in testUpdateDrawState()
64 BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.BLACK); in testUpdateDrawStateNull()
71 BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.CYAN); in testGetBackgroundColor()
72 assertEquals(Color.CYAN, backgroundColorSpan.getBackgroundColor()); in testGetBackgroundColor()
74 backgroundColorSpan = new BackgroundColorSpan(Color.GRAY); in testGetBackgroundColor()
[all …]
DForegroundColorSpanTest.java21 import android.graphics.Color;
37 ForegroundColorSpan f = new ForegroundColorSpan(Color.GREEN); in testConstructor()
51 ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.BLUE); in testGetForegroundColor()
52 assertEquals(Color.BLUE, foregroundColorSpan.getForegroundColor()); in testGetForegroundColor()
54 foregroundColorSpan = new ForegroundColorSpan(Color.BLACK); in testGetForegroundColor()
55 assertEquals(Color.BLACK, foregroundColorSpan.getForegroundColor()); in testGetForegroundColor()
60 ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.CYAN); in testUpdateDrawState()
66 assertEquals(Color.CYAN, tp.getColor()); in testUpdateDrawState()
68 foregroundColorSpan = new ForegroundColorSpan(Color.DKGRAY); in testUpdateDrawState()
70 assertEquals(Color.DKGRAY, tp.getColor()); in testUpdateDrawState()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/view/
DAlphaTestView.java21 import android.graphics.Color;
33 private int mStartColor = Color.RED;
34 private int mEndColor = Color.BLUE;
78 float a = (float) Color.alpha(color1) * inverseRatio + (float) Color.alpha(color2) * ratio; in blendColor()
79 float r = (float) Color.red(color1) * inverseRatio + (float) Color.red(color2) * ratio; in blendColor()
80 float g = (float) Color.green(color1) * inverseRatio + (float) Color.green(color2) * ratio; in blendColor()
81 float b = (float) Color.blue(color1) * inverseRatio + (float) Color.blue(color2) * ratio; in blendColor()
82 return Color.argb((int) a, (int) r, (int) g, (int) b); in blendColor()

12345678910>>...16