Home
last modified time | relevance | path

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

12345

/cts/tests/tests/graphics/src/android/graphics/cts/
DColorTest.java18 import android.graphics.Color;
24 assertEquals(0xff, Color.alpha(Color.RED)); in testAlpha()
25 assertEquals(0xff, Color.alpha(Color.YELLOW)); in testAlpha()
26 new Color(); in testAlpha()
30 assertEquals(Color.RED, Color.argb(0xff, 0xff, 0x00, 0x00)); in testArgb()
31 assertEquals(Color.YELLOW, Color.argb(0xff, 0xff, 0xff, 0x00)); in testArgb()
35 assertEquals(0x00, Color.blue(Color.RED)); in testBlue()
36 assertEquals(0x00, Color.blue(Color.YELLOW)); in testBlue()
40 assertEquals(0x00, Color.green(Color.RED)); in testGreen()
41 assertEquals(0xff, Color.green(Color.GREEN)); in testGreen()
[all …]
DLightingColorFilterTest.java22 import android.graphics.Color;
39 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
40 paint.setColorFilter(new LightingColorFilter(Color.WHITE, Color.BLACK)); in testLightingColorFilter()
42 assertColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
44 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
45 paint.setColorFilter(new LightingColorFilter(Color.CYAN, Color.BLACK)); in testLightingColorFilter()
47 assertColor(Color.BLUE, bitmap.getPixel(0, 0)); in testLightingColorFilter()
49 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
50 paint.setColorFilter(new LightingColorFilter(Color.BLUE, Color.GREEN)); in testLightingColorFilter()
52 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
[all …]
DLinearGradientTest.java22 import android.graphics.Color;
34 int[] color = { Color.BLUE, Color.GREEN, Color.RED }; in testLinearGradient()
43 assertTrue(Color.blue(b.getPixel(10, 0)) > Color.blue(b.getPixel(10, 5))); in testLinearGradient()
44 assertTrue(Color.blue(b.getPixel(10, 5)) > Color.blue(b.getPixel(10, 10))); in testLinearGradient()
45 assertTrue(Color.green(b.getPixel(10, 0)) < Color.green(b.getPixel(10, 5))); in testLinearGradient()
46 assertTrue(Color.green(b.getPixel(10, 5)) < Color.green(b.getPixel(10, 10))); in testLinearGradient()
48 assertTrue(Color.green(b.getPixel(10, 15)) > Color.green(b.getPixel(10, 20))); in testLinearGradient()
49 assertTrue(Color.green(b.getPixel(10, 20)) > Color.green(b.getPixel(10, 25))); in testLinearGradient()
50 assertTrue(Color.red(b.getPixel(10, 15)) < Color.red(b.getPixel(10, 20))); in testLinearGradient()
51 assertTrue(Color.red(b.getPixel(10, 20)) < Color.red(b.getPixel(10, 25))); in testLinearGradient()
[all …]
DColorMatrixColorFilterTest.java21 import android.graphics.Color;
47 paint.setColor(Color.BLUE); in testColorMatrixColorFilter()
50 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
51 paint.setColor(Color.GREEN); in testColorMatrixColorFilter()
53 assertColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
54 paint.setColor(Color.RED); in testColorMatrixColorFilter()
56 assertColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
58 paint.setColor(Color.MAGENTA); in testColorMatrixColorFilter()
60 assertColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
70 paint.setColor(Color.RED); in testColorMatrixColorFilter()
[all …]
DSweepGradientTest.java22 import android.graphics.Color;
48 mBitmap.eraseColor(Color.TRANSPARENT); in setUp()
53 final int[] colors = new int[] { Color.GREEN, Color.RED }; in test2Colors()
62 final int[] colors = new int[] { Color.GREEN, Color.RED, Color.BLUE }; in testColorArray()
72 final int[] colors = new int[] { Color.GREEN, Color.RED, Color.BLUE, Color.GREEN }; in testMultiColor()
110 int alpha = (int) ((1d - delta) * Color.alpha(colors[i1]) + in checkColors()
111 delta * Color.alpha(colors[i2])); in checkColors()
112 int red = (int) ((1d - delta) * Color.red(colors[i1]) + in checkColors()
113 delta * Color.red(colors[i2])); in checkColors()
114 int green = (int) ((1d - delta) * Color.green(colors[i1]) + in checkColors()
[all …]
DPixelXorXfermodeTest.java21 import android.graphics.Color;
33 b1.eraseColor(Color.WHITE); in testPixelXorXfermode()
35 b2.eraseColor(Color.CYAN); in testPixelXorXfermode()
38 target.eraseColor(Color.BLACK); in testPixelXorXfermode()
42 p.setXfermode(new PixelXorXfermode(Color.GREEN)); in testPixelXorXfermode()
44 assertEquals(Color.WHITE, target.getPixel(width / 4, height / 4)); in testPixelXorXfermode()
46 assertEquals(Color.YELLOW, target.getPixel(width / 4, height * 3 / 4)); in testPixelXorXfermode()
48 assertEquals(Color.BLUE, target.getPixel(width * 3 / 4, height * 3 / 4)); in testPixelXorXfermode()
51 p.setXfermode(new PixelXorXfermode(alphaColor(Color.GREEN, 25))); in testPixelXorXfermode()
52 target.eraseColor(alphaColor(Color.BLACK, 42)); in testPixelXorXfermode()
[all …]
DPorterDuffColorFilterTest.java20 import android.graphics.Color;
35 b1.eraseColor(Color.RED); in testPorterDuffColorFilter()
37 b2.eraseColor(Color.BLUE); in testPorterDuffColorFilter()
40 target.eraseColor(Color.TRANSPARENT); in testPorterDuffColorFilter()
43 int filterColor = Color.argb(0x80, 0, 0xFF, 0); in testPorterDuffColorFilter()
49 assertEquals(Color.RED, target.getPixel(width / 4, height / 4)); in testPorterDuffColorFilter()
51 assertEquals(0x80, Color.red(lowerLeft), TOLERANCE); in testPorterDuffColorFilter()
52 assertEquals(0x80, Color.green(lowerLeft), TOLERANCE); in testPorterDuffColorFilter()
56 target.eraseColor(Color.BLACK); in testPorterDuffColorFilter()
62 assertEquals(Color.RED, target.getPixel(width / 4, height / 4)); in testPorterDuffColorFilter()
[all …]
DPorterDuffXfermodeTest.java21 import android.graphics.Color;
36 target.eraseColor(Color.TRANSPARENT); in testPorterDuffXfermode()
38 b1.eraseColor(Color.RED); in testPorterDuffXfermode()
40 b2.eraseColor(Color.BLUE); in testPorterDuffXfermode()
47 assertEquals(Color.RED, target.getPixel(WIDTH / 4, HEIGHT / 4)); in testPorterDuffXfermode()
48 assertEquals(Color.BLUE, target.getPixel(WIDTH / 4, HEIGHT * 3 / 4)); in testPorterDuffXfermode()
49 assertEquals(Color.BLUE, target.getPixel(WIDTH * 3 / 4, HEIGHT * 3 / 4)); in testPorterDuffXfermode()
51 target.eraseColor(Color.TRANSPARENT); in testPorterDuffXfermode()
56 assertEquals(Color.RED, target.getPixel(WIDTH / 4, HEIGHT / 4)); in testPorterDuffXfermode()
57 assertEquals(Color.RED, target.getPixel(WIDTH / 4, HEIGHT * 3 / 4)); in testPorterDuffXfermode()
[all …]
DBlurMaskFilterTest.java22 import android.graphics.Color;
41 paint.setColor(Color.RED); in testBlurMaskFilter()
43 b.eraseColor(Color.TRANSPARENT); in testBlurMaskFilter()
50 checkQuadrants(Color.TRANSPARENT, b, x, y, 5); in testBlurMaskFilter()
53 checkQuadrants(Color.RED, b, x, y, 5); in testBlurMaskFilter()
56 checkQuadrants(Color.RED, b, x, y, 255); in testBlurMaskFilter()
77 assertEquals(Color.red(expected), Color.red(actual)); in checkColor()
78 assertEquals(Color.green(expected), Color.green(actual)); in checkColor()
79 assertEquals(Color.blue(expected), Color.blue(actual)); in checkColor()
80 assertEquals(Color.alpha(expected), Color.alpha(actual), alphaTolerance); in checkColor()
DComposeShaderTest.java22 import android.graphics.Color;
43 Color.GREEN, Color.BLUE, Shader.TileMode.CLAMP); in testPorterDuff()
45 Color.GREEN, Color.RED, Shader.TileMode.CLAMP); in testPorterDuff()
61 assertEquals(0xFF, Color.alpha(pixel), TOLERANCE); in testPorterDuff()
62 assertEquals(y, Color.red(pixel), TOLERANCE); in testPorterDuff()
63 assertEquals(green, Color.green(pixel), TOLERANCE); in testPorterDuff()
64 assertEquals(x, Color.blue(pixel), TOLERANCE); in testPorterDuff()
75 greenBitmap.eraseColor(Color.GREEN); in testXfermode()
77 cyanBitmap.eraseColor(Color.CYAN); in testXfermode()
82 PixelXorXfermode xferMode = new PixelXorXfermode(Color.WHITE); in testXfermode()
[all …]
DAvoidXfermodeTest.java21 import android.graphics.Color;
41 greenPaint.setColor(Color.GREEN); in testAvoidXfermode()
45 redAvoidingGreenPaint.setColor(Color.RED); in testAvoidXfermode()
50 blueTargetingGreenPaint.setColor(Color.BLUE); in testAvoidXfermode()
54 b.eraseColor(Color.BLACK); in testAvoidXfermode()
63 assertEquals(Color.GREEN, b.getPixel(BASE_SIZE / 2, BASE_SIZE / 2)); in testAvoidXfermode()
64 assertEquals(Color.RED, b.getPixel(BASE_SIZE + BASE_SIZE / 2, BASE_SIZE / 2)); in testAvoidXfermode()
65 assertEquals(Color.BLUE, b.getPixel(BASE_SIZE / 2, BASE_SIZE + BASE_SIZE / 2)); in testAvoidXfermode()
66 assertEquals(Color.BLACK, b.getPixel(BASE_SIZE + BASE_SIZE / 2, BASE_SIZE + BASE_SIZE / 2)); in testAvoidXfermode()
/cts/tests/tests/text/src/android/text/style/cts/
DForegroundColorSpanTest.java20 import android.graphics.Color;
29 ForegroundColorSpan f = new ForegroundColorSpan(Color.GREEN); in testConstructor()
42 ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.BLUE); in testGetForegroundColor()
43 assertEquals(Color.BLUE, foregroundColorSpan.getForegroundColor()); in testGetForegroundColor()
45 foregroundColorSpan = new ForegroundColorSpan(Color.BLACK); in testGetForegroundColor()
46 assertEquals(Color.BLACK, foregroundColorSpan.getForegroundColor()); in testGetForegroundColor()
50 ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.CYAN); in testUpdateDrawState()
56 assertEquals(Color.CYAN, tp.getColor()); in testUpdateDrawState()
58 foregroundColorSpan = new ForegroundColorSpan(Color.DKGRAY); in testUpdateDrawState()
60 assertEquals(Color.DKGRAY, tp.getColor()); in testUpdateDrawState()
[all …]
DBackgroundColorSpanTest.java20 import android.graphics.Color;
29 BackgroundColorSpan b = new BackgroundColorSpan(Color.GREEN); in testConstructor()
42 BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.BLACK); in testUpdateDrawState()
46 assertEquals(Color.BLACK, tp.bgColor); in testUpdateDrawState()
48 backgroundColorSpan = new BackgroundColorSpan(Color.BLUE); in testUpdateDrawState()
50 assertEquals(Color.BLUE, tp.bgColor); in testUpdateDrawState()
61 BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.CYAN); in testGetBackgroundColor()
62 assertEquals(Color.CYAN, backgroundColorSpan.getBackgroundColor()); in testGetBackgroundColor()
64 backgroundColorSpan = new BackgroundColorSpan(Color.GRAY); in testGetBackgroundColor()
65 assertEquals(Color.GRAY, backgroundColorSpan.getBackgroundColor()); in testGetBackgroundColor()
[all …]
DQuoteSpanTest.java21 import android.graphics.Color;
31 QuoteSpan q = new QuoteSpan(Color.RED); in testConstructor()
51 QuoteSpan quoteSpan = new QuoteSpan(Color.BLACK); in testGetColor()
52 assertEquals(Color.BLACK, quoteSpan.getColor()); in testGetColor()
54 quoteSpan = new QuoteSpan(Color.BLUE); in testGetColor()
55 assertEquals(Color.BLUE, quoteSpan.getColor()); in testGetColor()
74 QuoteSpan quoteSpan = new QuoteSpan(Color.RED); in testDescribeContents()
79 QuoteSpan quoteSpan = new QuoteSpan(Color.RED); in testGetSpanTypeId()
86 QuoteSpan quoteSpan = new QuoteSpan(Color.RED); in testWriteToParcel()
90 assertEquals(Color.RED, q.getColor()); in testWriteToParcel()
[all …]
DTextAppearanceSpanTest.java21 import android.graphics.Color;
33 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testConstructor()
70 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testGetFamily()
79 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testUpdateMeasureState()
101 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testGetTextColor()
119 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testGetTextSize()
134 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testGetTextStyle()
143 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testGetLinkTextColor()
155 int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK }; in testUpdateDrawState()
/cts/tests/tests/animation/src/android/animation/cts/
DArgbEvaluatorTest.java20 import android.graphics.Color;
27 int aRED = Color.alpha(RED); in testEvaluate()
28 int rRED = Color.red(RED); in testEvaluate()
29 int gRED = Color.green(RED); in testEvaluate()
30 int bRED = Color.blue(RED); in testEvaluate()
31 int aBLUE = Color.alpha(BLUE); in testEvaluate()
32 int rBLUE = Color.red(BLUE); in testEvaluate()
33 int gBLUE = Color.green(BLUE); in testEvaluate()
34 int bBLUE = Color.blue(BLUE); in testEvaluate()
48 int aResult = Color.alpha(result); in testEvaluate()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapcomparers/
DPSNRComparer.java18 import android.graphics.Color;
63 MSE += (Color.red(ideal[index]) - Color.red(given[index])) * in verifySame()
64 (Color.red(ideal[index]) - Color.red(given[index])); in verifySame()
65 MSE += (Color.blue(ideal[index]) - Color.blue(given[index])) * in verifySame()
66 (Color.blue(ideal[index]) - Color.blue(given[index])); in verifySame()
67 MSE += (Color.green(ideal[index]) - Color.green(given[index])) * in verifySame()
68 (Color.green(ideal[index]) - Color.green(given[index])); in verifySame()
DWeightedPixelDifference.java18 import android.graphics.Color;
59 error += Math.abs(Color.red(color1) - Color.red(color2)); in errorBetweenPixels()
60 error += Math.abs(Color.green(color1) - Color.green(color2)); in errorBetweenPixels()
61 error += Math.abs(Color.blue(color1) - Color.blue(color2)); in errorBetweenPixels()
62 error += Math.abs(Color.alpha(color1) - Color.alpha(color2)); in errorBetweenPixels()
DNearPixelComparer.java18 import android.graphics.Color;
61 int error = Math.abs(Color.red(ideal) - Color.red(given)); in pixelsAreSame()
62 error += Math.abs(Color.green(ideal) - Color.green(given)); in pixelsAreSame()
63 error += Math.abs(Color.blue(ideal) - Color.blue(given)); in pixelsAreSame()
/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()
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DExactCanvasTests.java20 import android.graphics.Color;
46 p.setColor(Color.BLUE); in testBlueRect()
50 .runWithVerifier(new RectVerifier(Color.WHITE, Color.BLUE, rect)); in testBlueRect()
62 p.setColor(Color.BLACK); in testPoints()
78 p.setColor(Color.RED); in testBlackRectWithStroke()
81 p.setColor(Color.BLACK); in testBlackRectWithStroke()
95 canvas.drawColor(Color.GREEN); in testBlackLineOnGreenBack()
97 p.setColor(Color.BLACK); in testBlackLineOnGreenBack()
111 canvas.drawColor(Color.BLUE); in testDrawRedRectOnBlueBack()
113 p.setColor(Color.RED); in testDrawRedRectOnBlueBack()
[all …]
DPathClippingTests.java20 import android.graphics.Color;
48 paint.setColor(Color.BLUE);
71 canvas.drawColor(Color.BLUE);
100 Color.WHITE, in testCircleWithPoints()
101 Color.BLUE, in testCircleWithPoints()
102 Color.WHITE, in testCircleWithPoints()
103 Color.WHITE, in testCircleWithPoints()
132 Color.BLUE, in testViewRotate()
133 Color.BLUE, in testViewRotate()
134 Color.WHITE, in testViewRotate()
[all …]
DShadowTests.java18 import android.graphics.Color;
45 Color.WHITE, in testShadowLayout()
46 Color.WHITE, in testShadowLayout()
47 Color.rgb(shadowColorValue, shadowColorValue, shadowColorValue), in testShadowLayout()
48 Color.rgb(shadowColorValue, shadowColorValue, shadowColorValue), in testShadowLayout()
/cts/tests/tests/openglperf/src/android/openglperf/cts/
DTextureTestRenderer.java19 import android.graphics.Color;
72 Color.RED, Color.RED, Color.BLUE, Color.BLUE, in TextureTestRenderer()
73 Color.RED, Color.RED, Color.BLUE, Color.BLUE, in TextureTestRenderer()
74 Color.GREEN, Color.GREEN, Color.CYAN, Color.CYAN, in TextureTestRenderer()
75 Color.GREEN, Color.GREEN, Color.CYAN, Color.CYAN in TextureTestRenderer()
/cts/tests/tests/content/src/android/content/res/cts/
DColorStateListTest.java26 import android.graphics.Color;
36 final int[] colors = new int[] { Color.RED, Color.BLUE }; in testColorStateList()
39 assertEquals(Color.RED, c.getDefaultColor()); in testColorStateList()
43 assertNotSame(Color.RED, c1.getDefaultColor()); in testColorStateList()
46 assertEquals(Color.RED & 0x00FF0000, c1.getDefaultColor() & 0x00FF0000); in testColorStateList()
58 c = ColorStateList.valueOf(Color.GRAY); in testColorStateList()
59 assertEquals(Color.GRAY, c.getDefaultColor()); in testColorStateList()

12345