Home
last modified time | relevance | path

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

123

/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()
DDiscretePathEffectTest.java22 import android.graphics.Color;
46 paint.setColor(Color.GREEN); in testDiscretePathEffect()
56 bitmap.eraseColor(Color.TRANSPARENT); in testDiscretePathEffect()
63 paint.setColor(Color.RED); in testDiscretePathEffect()
70 paint.setColor(Color.BLUE); in testDiscretePathEffect()
81 if (Color.green(pixel) > 0) { in testDiscretePathEffect()
85 assertEquals(0xFF, Color.blue(pixel)); in testDiscretePathEffect()
86 if (Color.red(pixel) > 0) { in testDiscretePathEffect()
DPaintFlagsDrawFilterTest.java22 import android.graphics.Color;
58 p.setColor(Color.RED); in drawText()
65 c.drawColor(Color.BLACK); in drawText()
72 combinedBitmap.eraseColor(Color.BLACK); in delta()
80 assertEquals(Color.RED, pixelWithoutFilter); in delta()
81 assertEquals(Color.BLACK, pixelWithFilter); in delta()
82 combinedBitmap.setPixel(i, j, Color.RED); in delta()
95 if (pixel == Color.RED) { in assertUnderline()
DPictureTest.java26 import android.graphics.Color;
79 paint.setColor(Color.GREEN); in drawPicture()
83 paint.setColor(Color.RED); in drawPicture()
86 paint.setColor(Color.BLUE); in drawPicture()
92 assertEquals(Color.BLUE, bitmap.getPixel(0, 0)); in checkBitmap()
94 assertEquals(Color.RED, bitmap.getPixel(x, 0)); in checkBitmap()
99 assertEquals(Color.GREEN, bitmap.getPixel(x, y)); in checkBitmap()
DEmbossMaskFilterTest.java22 import android.graphics.Color;
47 paint.setColor(Color.GRAY); in testEmbossMaskFilter()
54 bitmap.eraseColor(Color.BLACK); in testEmbossMaskFilter()
87 color += Color.red(pixel) + Color.green(pixel) + Color.blue(pixel); in brightness()
DPathDashPathEffectTest.java22 import android.graphics.Color;
41 b.eraseColor(Color.BLACK); in testPathDashPathEffect()
47 p.setColor(Color.RED); in testPathDashPathEffect()
51 expected.eraseColor(Color.BLACK); in testPathDashPathEffect()
54 p.setColor(Color.RED); in testPathDashPathEffect()
/cts/tests/tests/text/src/android/text/style/cts/
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 …]
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 …]
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()
DClickableSpanTest.java20 import android.graphics.Color;
32 tp.linkColor = Color.RED; in testUpdateDrawState()
37 assertEquals(Color.RED, tp.getColor()); in testUpdateDrawState()
40 tp.linkColor = Color.BLUE; in testUpdateDrawState()
42 assertEquals(Color.BLUE, tp.getColor()); 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/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()
/cts/suite/cts/deviceTests/browserbench/assets/octane/
Draytrace.js77 Flog.RayTracer.Color = Class.create();
79 Flog.RayTracer.Color.prototype = { class in Flog.RayTracer
95 var result = new Flog.RayTracer.Color(0,0,0);
105 var result = new Flog.RayTracer.Color(0,0,0);
117 var result = new Flog.RayTracer.Color(0,0,0);
127 var result = new Flog.RayTracer.Color(0,0,0);
137 var result = new Flog.RayTracer.Color(0,0,0);
147 var result = new Flog.RayTracer.Color(0,0,0);
168 var result = new Flog.RayTracer.Color(0,0,0);
169 result = Flog.RayTracer.Color.prototype.add(
[all …]

123