SkPaint paint; paint.setColor(SK_ColorRED); SkColor color = paint.getColor();
SkPaint paint; paint.setColor(SK_ColorGREEN); SkColor color = paint.getColor(); int r = SkColorGetR(color); int g = SkColorGetG(color); int b = SkColorGetB(color); int a = SkColorGetA(color); printf("RGBA: %d, %d, %d, %d", r, g, b, a);In this example, we create a SkPaint object, set its color to green, and then get the color using the getColor function. We then use Skia's SkColorGetR(), SkColorGetG(), SkColorGetB(), and SkColorGetA() functions to extract the red, green, blue, and alpha values of the SkColor. Finally, we print out these values using printf. Package library: Skia