Flutter Engine
The Flutter Engine
Functions
RGBA4f_toSkColor.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (RGBA4f_toSkColor, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( RGBA4f_toSkColor  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file RGBA4f_toSkColor.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 float red = 0.07f, green = 0.13f, blue = 0.32f, alpha = 0.17f;
7 SkColor4f color4f = { red, green, blue, alpha };
8 SkColor argb = color4f.toSkColor();
9 SkDebugf("red=%u green=%u blue=%u alpha=%u\n", SkColorGetR(argb),
10 SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));
11 SkColor4f fromSkColor = SkColor4f::FromColor(argb);
12 SkDebugf("red=%g green=%g blue=%g alpha=%g\n", fromSkColor.fR, fromSkColor.fG,
13 fromSkColor.fB, fromSkColor.fA);
14}
15} // END FIDDLE
#define SkColorGetR(color)
Definition: SkColor.h:65
#define SkColorGetG(color)
Definition: SkColor.h:69
uint32_t SkColor
Definition: SkColor.h:37
#define SkColorGetA(color)
Definition: SkColor.h:61
#define SkColorGetB(color)
Definition: SkColor.h:73
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27