blob: b32eebeb67156d3f57880b4aa0a07f0ae34aa2eb [file] [log] [blame]
Cary Clark2d4bf5f2018-04-16 08:37:38 -04001#Topic Color
Cary Clark137b8742018-05-30 09:21:49 -04002#Alias Color_Reference ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -04003
Cary Clark61313f32018-10-08 14:57:48 -04004#Code
Cary Clark2d4bf5f2018-04-16 08:37:38 -04005#Populate
6##
7
Cary Clark682c58d2018-05-16 07:07:07 -04008Color constants can be helpful to write code, documenting the meaning of values
9the represent transparency and color values. The use of Color constants is not
10required.
11
Cary Clark61313f32018-10-08 14:57:48 -040012#Subtopic Functions
13#Line # routines to read, write, and manipulate SkColor ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040014##
15
Cary Clark2d4bf5f2018-04-16 08:37:38 -040016# ------------------------------------------------------------------------------
17
Cary Clark682c58d2018-05-16 07:07:07 -040018#Subtopic Alpha
Cary Clark61313f32018-10-08 14:57:48 -040019#Line # transparency of Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040020
Cary Clark682c58d2018-05-16 07:07:07 -040021Alpha represents the transparency of Color. Color with Alpha of zero is fully
22transparent. Color with Alpha of 255 is fully opaque. Some, but not all pixel
23formats contain Alpha. Pixels with Alpha may store it as unsigned integers or
24floating point values. Unsigned integer Alpha ranges from zero, fully
25transparent, to all bits set, fully opaque. Floating point Alpha ranges from
26zero, fully transparent, to one, fully opaque.
27
Cary Clark137b8742018-05-30 09:21:49 -040028#Alias Alpha
29#Substitute alpha
30##
Cary Clark682c58d2018-05-16 07:07:07 -040031
32#Typedef uint8_t SkAlpha
33#Line # defines Alpha as eight bits ##
34
Cary Clarkffb3d682018-05-17 12:17:28 -040035#Code
Cary Clarka90ea222018-10-16 10:30:28 -040036#Populate
Cary Clarkffb3d682018-05-17 12:17:28 -040037##
38
Cary Clark0d225392018-06-07 09:59:07 -0400398-bit type for an alpha value. 255 is 100% opaque, zero is 100% transparent.
Cary Clark2d4bf5f2018-04-16 08:37:38 -040040
41#Typedef ##
42
Cary Clark682c58d2018-05-16 07:07:07 -040043#Subtopic ##
44
Cary Clark2d4bf5f2018-04-16 08:37:38 -040045# ------------------------------------------------------------------------------
46
47#Typedef uint32_t SkColor
Cary Clark682c58d2018-05-16 07:07:07 -040048#Line # defines Color as 32 bits ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040049
Cary Clarkffb3d682018-05-17 12:17:28 -040050#Code
Cary Clarka90ea222018-10-16 10:30:28 -040051#Populate
Cary Clarkffb3d682018-05-17 12:17:28 -040052##
53
Cary Clark682c58d2018-05-16 07:07:07 -04005432-bit ARGB Color value, Unpremultiplied. Color components are always in
Cary Clark2d4bf5f2018-04-16 08:37:38 -040055a known order. This is different from SkPMColor, which has its bytes in a configuration
56dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor
57is the type used to specify colors in SkPaint and in gradients.
58
Cary Clark682c58d2018-05-16 07:07:07 -040059Color that is Premultiplied has the same component values as Color
60that is Unpremultiplied if Alpha is 255, fully opaque, although may have the
61component values in a different order.
62
63#SeeAlso SkPMColor
64
Cary Clark2d4bf5f2018-04-16 08:37:38 -040065#Typedef ##
66
67# ------------------------------------------------------------------------------
68
69#Method static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Cary Clark61313f32018-10-08 14:57:48 -040070#In Functions
Cary Clarkffb3d682018-05-17 12:17:28 -040071#Line # returns Color_Alpha and RGB combined ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040072
Cary Clark682c58d2018-05-16 07:07:07 -040073Returns Color value from 8-bit component values. Asserts if SK_DEBUG is defined
74if a, r, g, or b exceed 255. Since Color is Unpremultiplied, a may be smaller
75than the largest of r, g, and b.
Cary Clark2d4bf5f2018-04-16 08:37:38 -040076
Cary Clark682c58d2018-05-16 07:07:07 -040077#Param a amount of Alpha, from fully transparent (0) to fully opaque (255) ##
Cary Clarkffb3d682018-05-17 12:17:28 -040078#Param r amount of red, from no red (0) to full red (255) ##
79#Param g amount of green, from no green (0) to full green (255) ##
80#Param b amount of blue, from no blue (0) to full blue (255) ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040081
Cary Clark682c58d2018-05-16 07:07:07 -040082#Return color and alpha, Unpremultiplied ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -040083
84#Example
Cary Clark682c58d2018-05-16 07:07:07 -040085 canvas->drawColor(SK_ColorRED);
86 canvas->clipRect(SkRect::MakeWH(150, 150));
87 canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0xFF, 0x00));
88 canvas->clipRect(SkRect::MakeWH(75, 75));
89 canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0x00, 0xFF));
Cary Clark2d4bf5f2018-04-16 08:37:38 -040090##
91
Cary Clarkffb3d682018-05-17 12:17:28 -040092#SeeAlso SkColorSetRGB SkPaint::setARGB SkPaint::setColor SkColorSetA
Cary Clark2d4bf5f2018-04-16 08:37:38 -040093
94#Method ##
95
96# ------------------------------------------------------------------------------
97
Cary Clark2d4bf5f2018-04-16 08:37:38 -040098#Define SkColorSetRGB
Cary Clark682c58d2018-05-16 07:07:07 -040099#Line # returns opaque Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400100
101#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400102#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400103##
104
Cary Clark682c58d2018-05-16 07:07:07 -0400105Returns Color value from 8-bit component values, with Alpha set
106fully opaque to 255.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400107
Cary Clarkffb3d682018-05-17 12:17:28 -0400108#Param r amount of red, from no red (0) to full red (255) ##
109#Param g amount of green, from no green (0) to full green (255) ##
110#Param b amount of blue, from no blue (0) to full blue (255) ##
Cary Clark682c58d2018-05-16 07:07:07 -0400111
112#Return color with opaque alpha ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400113
114#Example
Cary Clark682c58d2018-05-16 07:07:07 -0400115 canvas->drawColor(SK_ColorRED);
116 canvas->clipRect(SkRect::MakeWH(150, 150));
117 canvas->drawColor(SkColorSetRGB(0x00, 0xFF, 0x00));
118 canvas->clipRect(SkRect::MakeWH(75, 75));
119 canvas->drawColor(SkColorSetRGB(0x00, 0x00, 0xFF));
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400120##
121
Cary Clarkffb3d682018-05-17 12:17:28 -0400122#SeeAlso SkColorSetARGB
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400123
124#Define ##
125
126# ------------------------------------------------------------------------------
127
128#Define SkColorGetA
Cary Clark682c58d2018-05-16 07:07:07 -0400129#Line # returns Alpha component ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400130
131#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400132#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400133##
134
Cary Clark682c58d2018-05-16 07:07:07 -0400135Returns Alpha byte from Color value.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400136
Cary Clark682c58d2018-05-16 07:07:07 -0400137#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400138
139#Example
Cary Clark61313f32018-10-08 14:57:48 -0400140 SkPaint paint;
141 paint.setAntiAlias(true);
142 paint.setColor(SK_ColorRED);
143 for (int alpha = 255; alpha >= 0; alpha -= 17) {
144 paint.setAlpha(alpha);
145 canvas->drawRect({5, 5, 100, 20}, paint);
146 SkAlpha alphaInPaint = SkColorGetA(paint.getColor());
147 canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);
148 canvas->translate(0, 15);
149 }
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400150##
151
Cary Clarkffb3d682018-05-17 12:17:28 -0400152#SeeAlso SkPaint::getAlpha
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400153
154#Define ##
155
156# ------------------------------------------------------------------------------
157
158#Define SkColorGetR
Cary Clarkffb3d682018-05-17 12:17:28 -0400159#Line # returns red component ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400160
161#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400162#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400163##
164
Cary Clark682c58d2018-05-16 07:07:07 -0400165Returns red component of Color, from zero to 255.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400166
Cary Clark682c58d2018-05-16 07:07:07 -0400167#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
168#Return red byte ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400169
170#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400171#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400172 canvas->drawBitmap(source, 0, 0);
173 SkPaint bgPaint;
174 bgPaint.setColor(0xafffffff);
175 canvas->drawRect({20, 50, 80, 70}, bgPaint);
176 uint8_t red = SkColorGetR(source.getColor(226, 128));
177 canvas->drawString(std::to_string(red).c_str(), 40, 65, SkPaint());
178 canvas->drawLine(80, 70, 226, 128, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400179##
180
Cary Clarkffb3d682018-05-17 12:17:28 -0400181#SeeAlso SkColorGetG SkColorGetB
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400182
183#Define ##
184
185# ------------------------------------------------------------------------------
186
187#Define SkColorGetG
Cary Clarkffb3d682018-05-17 12:17:28 -0400188#Line # returns green component ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400189
190#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400191#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400192##
193
Cary Clark682c58d2018-05-16 07:07:07 -0400194Returns green component of Color, from zero to 255.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400195
Cary Clark682c58d2018-05-16 07:07:07 -0400196#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
197#Return green byte ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400198
199#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400200#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400201 canvas->drawBitmap(source, 0, 0);
202 SkPaint bgPaint;
203 bgPaint.setColor(0xafffffff);
204 canvas->drawRect({20, 50, 80, 70}, bgPaint);
205 uint8_t green = SkColorGetG(source.getColor(57, 192));
206 canvas->drawString(std::to_string(green).c_str(), 40, 65, SkPaint());
Cary Clarkffb3d682018-05-17 12:17:28 -0400207 canvas->drawLine(80, 70, 57, 192, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400208##
209
Cary Clarkffb3d682018-05-17 12:17:28 -0400210#SeeAlso SkColorGetR SkColorGetB
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400211
212#Define ##
213
214# ------------------------------------------------------------------------------
215
216#Define SkColorGetB
Cary Clarkffb3d682018-05-17 12:17:28 -0400217#Line # returns blue component ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400218
219#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400220#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400221##
222
Cary Clark682c58d2018-05-16 07:07:07 -0400223Returns blue component of Color, from zero to 255.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400224
Cary Clark682c58d2018-05-16 07:07:07 -0400225#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
226#Return blue byte ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400227
228#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400229#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400230 canvas->drawBitmap(source, 0, 0);
231 SkPaint bgPaint;
232 bgPaint.setColor(0xafffffff);
233 canvas->drawRect({20, 50, 80, 70}, bgPaint);
234 uint8_t blue = SkColorGetB(source.getColor(168, 170));
235 canvas->drawString(std::to_string(blue).c_str(), 40, 65, SkPaint());
Cary Clarkffb3d682018-05-17 12:17:28 -0400236 canvas->drawLine(80, 70, 168, 170, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400237##
238
Cary Clarkffb3d682018-05-17 12:17:28 -0400239#SeeAlso SkColorGetR SkColorGetG
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400240
241#Define ##
242
243# ------------------------------------------------------------------------------
244
245#Method static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a)
Cary Clark61313f32018-10-08 14:57:48 -0400246#In Functions
Cary Clarkffb3d682018-05-17 12:17:28 -0400247#Line # returns Color with transparency ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400248
Cary Clarkffb3d682018-05-17 12:17:28 -0400249Returns Unpremultiplied Color with red, blue, and green set from c; and alpha set
250from a. Alpha component of c is ignored and is replaced by a in result.
Cary Clark682c58d2018-05-16 07:07:07 -0400251
Cary Clarkffb3d682018-05-17 12:17:28 -0400252#Param c packed RGB, eight bits per component ##
253#Param a Alpha: transparent at zero, fully opaque at 255 ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400254
Cary Clarkffb3d682018-05-17 12:17:28 -0400255#Return Color with transparency ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400256
257#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400258#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400259 canvas->drawBitmap(source, 0, 0);
260 for (int y = 0; y < 256; y += 16) {
261 for (int x = 0; x < 256; x += 16) {
262 SkColor color = source.getColor(x + 8, y + 8);
263 SkPaint paint;
264 paint.setColor(SkColorSetA(color, x + y));
265 canvas->drawRect(SkRect::MakeXYWH(x, y, 16, 16), paint);
266 }
267 }
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400268##
269
Cary Clarkffb3d682018-05-17 12:17:28 -0400270#SeeAlso SkColorSetARGB
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400271
272#Method ##
273
274# ------------------------------------------------------------------------------
275
Cary Clark682c58d2018-05-16 07:07:07 -0400276#Subtopic Alpha_Constants
277#In Constant
278#Line # constants for Alpha ##
Cary Clarka90ea222018-10-16 10:30:28 -0400279#Filter SK_Alpha
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400280
281#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400282#Populate
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400283##
284
Cary Clark682c58d2018-05-16 07:07:07 -0400285Alpha constants are conveniences to represent fully transparent and fully
286opaque colors and masks. Their use is not required.
287
288#Const SK_AlphaTRANSPARENT 0x00
289#Line # fully transparent SkAlpha ##
Cary Clark682c58d2018-05-16 07:07:07 -0400290Represents fully transparent SkAlpha value. SkAlpha ranges from zero,
291fully transparent; to 255, fully opaque.
292##
293#Const SK_AlphaOPAQUE 0xFF
294#Line # fully opaque SkAlpha ##
Cary Clark682c58d2018-05-16 07:07:07 -0400295Represents fully opaque SkAlpha value. SkAlpha ranges from zero,
296fully transparent; to 255, fully opaque.
297##
298
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400299#Example
Cary Clark682c58d2018-05-16 07:07:07 -0400300#Image 1
301#Height 128
302#Description
303Color the parts of the bitmap red if they mostly contain transparent pixels.
304##
305 std::vector<int32_t> srcPixels;
306 srcPixels.resize(source.height() * source.rowBytes());
307 SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),
308 &srcPixels.front(), source.rowBytes());
309 source.readPixels(pixmap, 0, 0);
310 for (int y = 0; y < 16; ++y) {
311 for (int x = 0; x < 16; ++x) {
312 int32_t* blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;
313 size_t transparentCount = 0;
314 for (int fillY = 0; fillY < source.height() / 16; ++fillY) {
315 for (int fillX = 0; fillX < source.width() / 16; ++fillX) {
316 const SkColor color = SkUnPreMultiply::PMColorToColor(blockStart[fillX]);
317 transparentCount += SkColorGetA(color) == SK_AlphaTRANSPARENT;
318 }
319 blockStart += source.width();
320 }
321 if (transparentCount > 200) {
322 blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;
323 for (int fillY = 0; fillY < source.height() / 16; ++fillY) {
324 for (int fillX = 0; fillX < source.width() / 16; ++fillX) {
325 blockStart[fillX] = SK_ColorRED;
326 }
327 blockStart += source.width();
328 }
329 }
330 }
331 }
332 SkBitmap bitmap;
333 bitmap.installPixels(pixmap);
334 canvas->drawBitmap(bitmap, 0, 0);
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400335##
336
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400337
338# ------------------------------------------------------------------------------
339
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400340#Example
Cary Clark682c58d2018-05-16 07:07:07 -0400341#Image 1
342#Height 128
Cary Clarka90ea222018-10-16 10:30:28 -0400343#Description
344Color the parts of the bitmap green if they contain fully opaque pixels.
345##
Cary Clark682c58d2018-05-16 07:07:07 -0400346 std::vector<int32_t> srcPixels;
347 srcPixels.resize(source.height() * source.rowBytes());
348 SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),
349 &srcPixels.front(), source.rowBytes());
350 source.readPixels(pixmap, 0, 0);
351 for (int y = 0; y < source.height(); ++y) {
352 for (int x = 0; x < source.width(); ++x) {
353 SkPMColor pixel = srcPixels[y * source.width() + x];
354 const SkColor color = SkUnPreMultiply::PMColorToColor(pixel);
355 if (SkColorGetA(color) == SK_AlphaOPAQUE) {
356 srcPixels[y * source.width() + x] = SK_ColorGREEN;
357 }
358 }
359 }
360 SkBitmap bitmap;
361 bitmap.installPixels(pixmap);
362 canvas->drawBitmap(bitmap, 0, 0);
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400363##
364
Cary Clarka90ea222018-10-16 10:30:28 -0400365#SeeAlso SkAlpha SK_ColorTRANSPARENT SK_ColorBLACK
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400366
Cary Clark682c58d2018-05-16 07:07:07 -0400367#Subtopic Alpha_Constants ##
368
369#Subtopic Color_Constants
370#In Constant
371#Line # constants for Color ##
Cary Clarka90ea222018-10-16 10:30:28 -0400372#Filter SK_Color
Cary Clark682c58d2018-05-16 07:07:07 -0400373
Cary Clark682c58d2018-05-16 07:07:07 -0400374#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400375#Populate
Cary Clark682c58d2018-05-16 07:07:07 -0400376##
377
378Color names are provided as conveniences, but are not otherwise special.
379The values chosen for names may not be the same as values used by
380SVG, HTML, CSS, or colors named by a platform.
381
Cary Clark682c58d2018-05-16 07:07:07 -0400382#Const SK_ColorTRANSPARENT 0x00000000
383#Line # transparent Color ##
Cary Clark682c58d2018-05-16 07:07:07 -0400384 Represents fully transparent SkColor. May be used to initialize a destination
385 containing a mask or a non-rectangular image.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400386##
Cary Clark682c58d2018-05-16 07:07:07 -0400387#Const SK_ColorBLACK 0xFF000000
388#Line # black Color ##
Cary Clark682c58d2018-05-16 07:07:07 -0400389 Represents fully opaque black.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400390##
Cary Clark682c58d2018-05-16 07:07:07 -0400391#Const SK_ColorDKGRAY 0xFF444444
392#Line # dark gray Color ##
393 Represents fully opaque dark gray.
394 Note that SVG_darkgray is equivalent to 0xFFA9A9A9.
395##
396#Const SK_ColorGRAY 0xFF888888
397#Line # gray Color ##
398 Represents fully opaque gray.
399 Note that HTML_Gray is equivalent to 0xFF808080.
400##
401#Const SK_ColorLTGRAY 0xFFCCCCCC
402#Line # light gray Color ##
403 Represents fully opaque light gray. HTML_Silver is equivalent to 0xFFC0C0C0.
404 Note that SVG_lightgray is equivalent to 0xFFD3D3D3.
405##
406#Const SK_ColorWHITE 0xFFFFFFFF
407#Line # white Color ##
408 Represents fully opaque white.
409##
410#Const SK_ColorRED 0xFFFF0000
411#Line # red Color ##
412 Represents fully opaque red.
413##
414#Const SK_ColorGREEN 0xFF00FF00
415#Line # green Color ##
416 Represents fully opaque green. HTML_Lime is equivalent.
417 Note that HTML_Green is equivalent to 0xFF008000.
418##
419#Const SK_ColorBLUE 0xFF0000FF
420#Line # blue Color ##
421 Represents fully opaque blue.
422##
423#Const SK_ColorYELLOW 0xFFFFFF00
424#Line # yellow Color ##
425 Represents fully opaque yellow.
426##
427#Const SK_ColorCYAN 0xFF00FFFF
428#Line # cyan Color ##
429 Represents fully opaque cyan. HTML_Aqua is equivalent.
430##
431#Const SK_ColorMAGENTA 0xFFFF00FF
432#Line # magenta Color ##
433 Represents fully opaque magenta. HTML_Fuchsia is equivalent.
434##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400435
Cary Clarka90ea222018-10-16 10:30:28 -0400436#Example
437###$
438$Function
439#define SKIA_COLOR_PAIR(name) "SK_Color" #name, SK_Color##name
440$$
441void draw(SkCanvas* canvas) {
442 struct ColorCompare {
443 const char* fSVGName;
444 SkColor fSVGColor;
445 const char* fSkiaName;
446 SkColor fSkiaColor;
447 } colorCompare[] = { // see https://www.w3.org/TR/SVG/types.html#ColorKeywords
448 {"black", SkColorSetRGB( 0, 0, 0), SKIA_COLOR_PAIR(BLACK) },
449 {"darkgray", SkColorSetRGB(169, 169, 169), SKIA_COLOR_PAIR(DKGRAY) },
450 {"gray", SkColorSetRGB(128, 128, 128), SKIA_COLOR_PAIR(GRAY) },
451 {"lightgray", SkColorSetRGB(211, 211, 211), SKIA_COLOR_PAIR(LTGRAY) },
452 {"white", SkColorSetRGB(255, 255, 255), SKIA_COLOR_PAIR(WHITE) },
453 {"red", SkColorSetRGB(255, 0, 0), SKIA_COLOR_PAIR(RED) },
454 {"green", SkColorSetRGB( 0, 128, 0), SKIA_COLOR_PAIR(GREEN) },
455 {"blue", SkColorSetRGB( 0, 0, 255), SKIA_COLOR_PAIR(BLUE) },
456 {"yellow", SkColorSetRGB(255, 255, 0), SKIA_COLOR_PAIR(YELLOW) },
457 {"aqua", SkColorSetRGB( 0, 255, 255), SKIA_COLOR_PAIR(CYAN) },
458 {"fuchsia", SkColorSetRGB(255, 0, 255), SKIA_COLOR_PAIR(MAGENTA) },
459 };
460 SkPaint paint;
461 paint.setAntiAlias(true);
462 paint.setTextSize(14);
463 for (auto compare : colorCompare) {
464 paint.setStyle(SkPaint::kFill_Style);
465 paint.setColor(compare.fSVGColor);
466 canvas->drawRect({5, 5, 15, 15}, paint);
467 paint.setColor(SK_ColorBLACK);
468 canvas->drawString(compare.fSVGName, 20, 16, paint);
469 paint.setColor(compare.fSkiaColor);
470 canvas->drawRect({105, 5, 115, 15}, paint);
471 paint.setColor(SK_ColorBLACK);
472 canvas->drawString(compare.fSkiaName, 120, 16, paint);
473 paint.setStyle(SkPaint::kStroke_Style);
474 canvas->drawRect({5, 5, 15, 15}, paint);
475 canvas->drawRect({105, 5, 115, 15}, paint);
476 canvas->translate(0, 20);
477 }
478}
479$$$#
480##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400481
482#Example
Cary Clarka90ea222018-10-16 10:30:28 -0400483#Description
484SK_ColorTRANSPARENT sets Color Alpha and components to zero.
485##
Cary Clarkffb3d682018-05-17 12:17:28 -0400486#Image 3
Cary Clark682c58d2018-05-16 07:07:07 -0400487 std::vector<uint32_t> srcPixels;
488 constexpr int width = 256;
489 constexpr int height = 256;
490 srcPixels.resize(width * height);
491 SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
492 SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
493 pixmap.erase(SK_ColorTRANSPARENT);
494 pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
495 pixmap.erase(SK_ColorTRANSPARENT, { 48, 48, 168, 168 } );
496 SkBitmap bitmap;
497 bitmap.installPixels(pixmap);
498 canvas->drawBitmap(bitmap, 0, 0);
499 canvas->drawBitmap(bitmap, 48, 48);
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400500##
501
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400502#Example
Cary Clarka90ea222018-10-16 10:30:28 -0400503#Description
504SK_ColorBLACK sets Color Alpha to one and components to zero.
505##
Cary Clark682c58d2018-05-16 07:07:07 -0400506 std::vector<uint32_t> srcPixels;
507 constexpr int width = 256;
508 constexpr int height = 256;
509 srcPixels.resize(width * height);
510 SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
511 SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
512 pixmap.erase(SK_ColorTRANSPARENT);
513 pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
514 pixmap.erase(SK_ColorBLACK, { 48, 48, 168, 168 } );
515 SkBitmap bitmap;
516 bitmap.installPixels(pixmap);
517 canvas->drawBitmap(bitmap, 0, 0);
518 canvas->drawBitmap(bitmap, 48, 48);
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400519##
520
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400521#Example
Cary Clarka90ea222018-10-16 10:30:28 -0400522#Description
523SK_ColorWHITE sets Color Alpha and components to one.
524##
Cary Clark682c58d2018-05-16 07:07:07 -0400525 std::vector<uint32_t> srcPixels;
526 constexpr int width = 256;
527 constexpr int height = 256;
528 srcPixels.resize(width * height);
529 SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
530 SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
531 pixmap.erase(SK_ColorTRANSPARENT);
532 pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
533 pixmap.erase(SK_ColorWHITE, { 48, 48, 168, 168 } );
534 SkBitmap bitmap;
535 bitmap.installPixels(pixmap);
536 canvas->drawBitmap(bitmap, 0, 0);
537 canvas->drawBitmap(bitmap, 48, 48);
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400538##
539
Cary Clarka90ea222018-10-16 10:30:28 -0400540#SeeAlso SK_ColorTRANSPARENT SkCanvas::clear SK_AlphaOPAQUE
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400541
Cary Clark682c58d2018-05-16 07:07:07 -0400542#Subtopic Color_Constants ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400543
544# ------------------------------------------------------------------------------
545
546#Subtopic HSV
Cary Clark61313f32018-10-08 14:57:48 -0400547#Line # hue saturation value color representation ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400548
549#Subtopic Hue
550Hue represents an angle, in degrees, on a color wheel. Hue has a positive value
551modulo 360, where zero degrees is red.
552##
553
554#Subtopic Saturation
Cary Clark0d225392018-06-07 09:59:07 -0400555Saturation represents the intensity of the color. Saturation varies from zero,
556with no Hue contribution; to one, with full Hue contribution.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400557##
558
559#Subtopic Value
Cary Clark0d225392018-06-07 09:59:07 -0400560Value represents the lightness of the color. Value varies from zero, black; to
561one, full brightness.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400562##
563
Cary Clarkffb3d682018-05-17 12:17:28 -0400564#Method void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
Cary Clark61313f32018-10-08 14:57:48 -0400565#In Functions
Cary Clarkffb3d682018-05-17 12:17:28 -0400566#Line # converts RGB to HSV ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400567
Cary Clarkffb3d682018-05-17 12:17:28 -0400568Converts RGB to its HSV components.
Cary Clark0d225392018-06-07 09:59:07 -0400569hsv[0] contains HSV_Hue, a value from zero to less than 360.
570hsv[1] contains HSV_Saturation, a value from zero to one.
571hsv[2] contains HSV_Value, a value from zero to one.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400572
Cary Clark682c58d2018-05-16 07:07:07 -0400573#Param red red component value from zero to 255 ##
574#Param green green component value from zero to 255 ##
575#Param blue blue component value from zero to 255 ##
576#Param hsv three element array which holds the resulting HSV components
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400577##
578
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400579#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400580#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400581 canvas->drawBitmap(source, 0, 0);
582 SkPaint bgPaint;
583 bgPaint.setColor(0xafffffff);
584 canvas->drawRect({20, 30, 110, 90}, bgPaint);
585 SkScalar hsv[3];
586 SkColor c = source.getColor(226, 128);
587 SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);
588 canvas->drawString(("h: " + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());
589 canvas->drawString(("s: " + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());
590 canvas->drawString(("v: " + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());
591 canvas->drawLine(110, 90, 226, 128, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400592##
593
Cary Clarkffb3d682018-05-17 12:17:28 -0400594#SeeAlso SkColorToHSV SkHSVToColor
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400595
596#Method ##
597
598# ------------------------------------------------------------------------------
599
Cary Clarkfd32e722018-11-16 14:36:02 -0500600#Method static void SkColorToHSV(SkColor color, SkScalar hsv[3])
Cary Clark61313f32018-10-08 14:57:48 -0400601#In Functions
Cary Clark682c58d2018-05-16 07:07:07 -0400602#Line # converts RGB to HSV ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400603
Cary Clark682c58d2018-05-16 07:07:07 -0400604Converts ARGB to its HSV components. Alpha in ARGB is ignored.
Cary Clark0d225392018-06-07 09:59:07 -0400605hsv[0] contains HSV_Hue, and is assigned a value from zero to less than 360.
606hsv[1] contains HSV_Saturation, a value from zero to one.
607hsv[2] contains HSV_Value, a value from zero to one.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400608
Cary Clark682c58d2018-05-16 07:07:07 -0400609#Param color ARGB color to convert
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400610##
Cary Clark682c58d2018-05-16 07:07:07 -0400611#Param hsv three element array which holds the resulting HSV components
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400612##
613
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400614#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400615#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400616 canvas->drawBitmap(source, 0, 0);
617 for (int y = 0; y < 256; ++y) {
618 for (int x = 0; x < 256; ++x) {
619 SkScalar hsv[3];
620 SkColorToHSV(source.getColor(x, y), hsv);
621 hsv[1] = 1 - hsv[1];
622 SkPaint paint;
623 paint.setColor(SkHSVToColor(hsv));
624 canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
625 }
626 }
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400627##
628
Cary Clarkffb3d682018-05-17 12:17:28 -0400629#SeeAlso SkRGBToHSV SkHSVToColor
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400630
631#Method ##
632
633# ------------------------------------------------------------------------------
634
Cary Clarkffb3d682018-05-17 12:17:28 -0400635#Method SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
Cary Clark61313f32018-10-08 14:57:48 -0400636#In Functions
Cary Clark682c58d2018-05-16 07:07:07 -0400637#Line # converts HSV with Alpha to RGB ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400638
Cary Clarkffb3d682018-05-17 12:17:28 -0400639Converts HSV components to an ARGB color. Alpha is passed through unchanged.
Cary Clark0d225392018-06-07 09:59:07 -0400640hsv[0] represents HSV_Hue, an angle from zero to less than 360.
641hsv[1] represents HSV_Saturation, and varies from zero to one.
642hsv[2] represents HSV_Value, and varies from zero to one.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400643
Cary Clarkffb3d682018-05-17 12:17:28 -0400644Out of range hsv values are pinned.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400645
Cary Clark682c58d2018-05-16 07:07:07 -0400646#Param alpha Alpha component of the returned ARGB color
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400647##
Cary Clark682c58d2018-05-16 07:07:07 -0400648#Param hsv three element array which holds the input HSV components
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400649##
650
Cary Clark682c58d2018-05-16 07:07:07 -0400651#Return ARGB equivalent to HSV
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400652##
653
654#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400655#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400656 canvas->drawBitmap(source, 0, 0);
657 for (int y = 0; y < 256; ++y) {
658 for (int x = 0; x < 256; ++x) {
659 SkColor color = source.getColor(x, y);
660 SkScalar hsv[3];
661 SkColorToHSV(color, hsv);
662 hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
663 SkPaint paint;
664 paint.setColor(SkHSVToColor(x + y, hsv));
665 canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
666 }
667 }
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400668##
669
Cary Clarkffb3d682018-05-17 12:17:28 -0400670#SeeAlso SkColorToHSV SkRGBToHSV
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400671
672#Method ##
673
674# ------------------------------------------------------------------------------
675
Cary Clarkfd32e722018-11-16 14:36:02 -0500676#Method static SkColor SkHSVToColor(const SkScalar hsv[3])
Cary Clark61313f32018-10-08 14:57:48 -0400677#In Functions
Cary Clarkffb3d682018-05-17 12:17:28 -0400678#Line # converts HSV to RGB ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400679
Cary Clark0d225392018-06-07 09:59:07 -0400680Converts HSV components to an ARGB color. Alpha is set to 255.
681hsv[0] represents HSV_Hue, an angle from zero to less than 360.
682hsv[1] represents HSV_Saturation, and varies from zero to one.
683hsv[2] represents HSV_Value, and varies from zero to one.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400684
Cary Clarkffb3d682018-05-17 12:17:28 -0400685Out of range hsv values are pinned.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400686
Cary Clarkffb3d682018-05-17 12:17:28 -0400687#Param hsv three element array which holds the input HSV components
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400688##
689
Cary Clarkffb3d682018-05-17 12:17:28 -0400690#Return RGB equivalent to HSV
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400691##
692
693#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400694#Image 3
Cary Clark61313f32018-10-08 14:57:48 -0400695 canvas->drawBitmap(source, 0, 0);
696 for (int y = 0; y < 256; ++y) {
697 for (int x = 0; x < 256; ++x) {
698 SkColor color = source.getColor(x, y);
699 SkScalar hsv[3];
700 SkColorToHSV(color, hsv);
701 hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
702 SkPaint paint;
703 paint.setColor(SkHSVToColor(hsv));
704 canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
705 }
706 }
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400707##
708
Cary Clarkffb3d682018-05-17 12:17:28 -0400709#SeeAlso SkColorToHSV SkRGBToHSV
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400710
711#Method ##
712
713#Subtopic HSV ##
714
715# ------------------------------------------------------------------------------
716
Cary Clark77b3f3a2018-11-07 14:59:03 -0500717#Subtopic PM_Color
Cary Clark61313f32018-10-08 14:57:48 -0400718#Line # color components premultiplied by Alpha ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400719
Cary Clark682c58d2018-05-16 07:07:07 -0400720#Typedef uint32_t SkPMColor
721#Line # defines Premultiplied Color as 32 bits ##
722
Cary Clarkffb3d682018-05-17 12:17:28 -0400723#Code
Cary Clarka90ea222018-10-16 10:30:28 -0400724#Populate
Cary Clarkffb3d682018-05-17 12:17:28 -0400725##
726
Cary Clark682c58d2018-05-16 07:07:07 -040072732-bit ARGB color value, Premultiplied. The byte order for this value is
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400728configuration dependent, matching the format of kBGRA_8888_SkColorType bitmaps.
Cary Clark682c58d2018-05-16 07:07:07 -0400729This is different from SkColor, which is Unpremultiplied, and is always in the
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400730same byte order.
731
732#Typedef ##
733
734# ------------------------------------------------------------------------------
735
Cary Clarkffb3d682018-05-17 12:17:28 -0400736#Method SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Cary Clark61313f32018-10-08 14:57:48 -0400737#In Functions
Cary Clark77b3f3a2018-11-07 14:59:03 -0500738#Line # converts Unpremultiplied ARGB to Premultiplied PM_Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400739
Cary Clarkffb3d682018-05-17 12:17:28 -0400740Returns a SkPMColor value from Unpremultiplied 8-bit component values.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400741
Cary Clarkffb3d682018-05-17 12:17:28 -0400742#Param a amount of Alpha, from fully transparent (0) to fully opaque (255) ##
743#Param r amount of red, from no red (0) to full red (255) ##
744#Param g amount of green, from no green (0) to full green (255) ##
745#Param b amount of blue, from no blue (0) to full blue (255) ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400746
Cary Clarkffb3d682018-05-17 12:17:28 -0400747#Return Premultiplied Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400748
749#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400750#Height 128
751#Width 300
Cary Clark61313f32018-10-08 14:57:48 -0400752 SkPMColor premultiplied = SkPreMultiplyARGB(160, 128, 160, 192);
753 canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
754 canvas->drawString("alpha=160 red=128 green=160 blue=192", 20, 40, SkPaint());
755 canvas->drawString("Premultiplied:", 20, 80, SkPaint());
756 std::string str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
757 str += " red=" + std::to_string(SkColorGetR(premultiplied));
758 str += " green=" + std::to_string(SkColorGetG(premultiplied));
759 str += " blue=" + std::to_string(SkColorGetB(premultiplied));
Cary Clarkffb3d682018-05-17 12:17:28 -0400760 canvas->drawString(str.c_str(), 20, 100, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400761##
762
Cary Clarkffb3d682018-05-17 12:17:28 -0400763#SeeAlso SkPreMultiplyColor
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400764
765#Method ##
766
767# ------------------------------------------------------------------------------
768
Cary Clarkffb3d682018-05-17 12:17:28 -0400769#Method SkPMColor SkPreMultiplyColor(SkColor c)
Cary Clark61313f32018-10-08 14:57:48 -0400770#In Functions
Cary Clark77b3f3a2018-11-07 14:59:03 -0500771#Line # converts Unpremultiplied Color to Premultiplied PM_Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400772
Cary Clark77b3f3a2018-11-07 14:59:03 -0500773Returns PM_Color closest to Color c. Multiplies c RGB components by the c Alpha,
Cary Clark682c58d2018-05-16 07:07:07 -0400774and arranges the bytes to match the format of kN32_SkColorType.
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400775
Cary Clarkffb3d682018-05-17 12:17:28 -0400776#Param c Unpremultiplied ARGB Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400777
Cary Clarkffb3d682018-05-17 12:17:28 -0400778#Return Premultiplied Color ##
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400779
780#Example
Cary Clarkffb3d682018-05-17 12:17:28 -0400781#Height 128
782#Width 300
Cary Clark61313f32018-10-08 14:57:48 -0400783 SkColor unpremultiplied = SkColorSetARGB(160, 128, 160, 192);
784 SkPMColor premultiplied = SkPreMultiplyColor(unpremultiplied);
785 canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
786 std::string str = "alpha=" + std::to_string(SkColorGetA(unpremultiplied));
787 str += " red=" + std::to_string(SkColorGetR(unpremultiplied));
788 str += " green=" + std::to_string(SkColorGetG(unpremultiplied));
789 str += " blue=" + std::to_string(SkColorGetB(unpremultiplied));
790 canvas->drawString(str.c_str(), 20, 40, SkPaint());
791 canvas->drawString("Premultiplied:", 20, 80, SkPaint());
792 str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
793 str += " red=" + std::to_string(SkColorGetR(premultiplied));
794 str += " green=" + std::to_string(SkColorGetG(premultiplied));
795 str += " blue=" + std::to_string(SkColorGetB(premultiplied));
Cary Clarkffb3d682018-05-17 12:17:28 -0400796 canvas->drawString(str.c_str(), 20, 100, SkPaint());
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400797##
798
Cary Clarkffb3d682018-05-17 12:17:28 -0400799#SeeAlso SkPreMultiplyARGB
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400800
801#Method ##
802
Cary Clark77b3f3a2018-11-07 14:59:03 -0500803#Subtopic PM_Color ##
Cary Clark682c58d2018-05-16 07:07:07 -0400804
Cary Clark2d4bf5f2018-04-16 08:37:38 -0400805#Topic Color ##