SkColor Reference

Color

Overview

Overview Subtopic

namedescription

Define

namedescription

Function

namedescription

Typedef

namedescription

Alpha

RGB

RGB Red

RGB Blue

RGB Green

ARGB

RBG

RGB-565

Gray

Types and macros for colors 8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent. 32 bit ARGB color value, not premultiplied. The color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor is the type used to specify colors in SkPaint and in gradients.

SkColorSetARGB

Return a SkColor value from 8 bit component values

Parameters

Return Value

incomplete

Example

See Also

incomplete


Legacy aliases.

See Also

incomplete

See Also

incomplete

Return a SkColor value from 8 bit component values, with an implied value of 0xFF for alpha (fully opaque)

Parameters

Example

See Also

incomplete

return the alpha byte from a SkColor value

Parameters

Example

See Also

incomplete

return the red byte from a SkColor value

Parameters

Example

See Also

incomplete

return the green byte from a SkColor value

Parameters

Example

See Also

incomplete

return the blue byte from a SkColor value

Parameters

Example

See Also

incomplete

SkColorSetA

Parameters

Return Value

incomplete

Example

See Also

incomplete


common colors transparent SkAlpha value

Example

See Also

incomplete

opaque SkAlpha value

Example

See Also

incomplete

transparent SkColor value

Example

See Also

incomplete

black SkColor value

Example

See Also

incomplete

dark gray SkColor value

Example

See Also

incomplete

gray SkColor value

Example

See Also

incomplete

light gray SkColor value

Example

See Also

incomplete

white SkColor value

Example

See Also

incomplete

red SkColor value

Example

See Also

incomplete

green SkColor value

Example

See Also

incomplete

blue SkColor value

Example

See Also

incomplete

yellow SkColor value

Example

See Also

incomplete

cyan SkColor value

Example

See Also

incomplete

magenta SkColor value

Example

See Also

incomplete

HSV

HSV Hue

Hue represents an angle, in degrees, on a color wheel. Hue has a positive value modulo 360, where zero degrees is red.

HSV Saturation

HSV Value

SkRGBToHSV

Convert RGB components to HSV. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Value [0...1]

Parameters

Return Value

incomplete

Example

See Also

incomplete


SkColorToHSV

Convert the argb color to its HSV components. hsv[0] represents Hue, and is assigned a value from zero to less than 360. hsv[1] is Saturation [0...1] hsv[2] is Value [0...1]

Parameters

Return Value

incomplete

Example

See Also

incomplete


SkHSVToColor

Convert HSV components to an ARGB color. The alpha component is passed through unchanged. hsv[0] represents Hue, an angle from zero to less than 360. hsv[1] represents Saturation, and varies from zero to one. hsv[2] represents Value, and varies from zero to one.

If hsv values are out of range, they are pinned.

Parameters

Return Value

the resulting argb color

Example

See Also

incomplete


Convert HSV components to an ARGB color. The alpha component set to 0xFF. hsv[0] represents Hue, an angle from zero to less than 360. hsv[1] represents Saturation, and varies from zero to one. hsv[2] represents Value, and varies from zero to one.

If hsv values are out of range, they are pinned.

Parameters

Return Value

the resulting argb color

Example

See Also

incomplete


32 bit ARGB color value, premultiplied. The byte order for this value is configuration dependent, matching the format of kBGRA_8888_SkColorType bitmaps. This is different from SkColor, which is nonpremultiplied, and is always in the same byte order.

SkPreMultiplyARGB

Return a SkPMColor value from unpremultiplied 8 bit component values

Parameters

Return Value

incomplete

Example

See Also

incomplete


SkPreMultiplyColor

Return a SkPMColor value from a SkColor value. This is done by multiplying the color components by the color's alpha, and by arranging the bytes in a configuration dependent order, to match the format of kBGRA_8888_SkColorType bitmaps.

Parameters

Return Value

incomplete

Example

See Also

incomplete