50 return SkASSERT(
a <= 255 && r <= 255 && g <= 255 &&
b <= 255),
51 (
a << 24) | (r << 16) | (g << 8) | (
b << 0);
57#define SkColorSetRGB(r, g, b) SkColorSetARGB(0xFF, r, g, b)
61#define SkColorGetA(color) (((color) >> 24) & 0xFF)
65#define SkColorGetR(color) (((color) >> 16) & 0xFF)
69#define SkColorGetG(color) (((color) >> 8) & 0xFF)
73#define SkColorGetB(color) (((color) >> 0) & 0xFF)
83 return (c & 0x00FFFFFF) | (
a << 24);
261template <SkAlphaType kAT>
274 return fA == other.
fA &&
fR == other.
fR &&
fG == other.
fG &&
fB == other.
fB;
283 return !(*
this == other);
308 const float*
vec()
const {
return &
fR; }
326 return this->
vec()[index];
336 return this->
vec()[index];
352 return fR >= 0.0f &&
fR <= 1.0f &&
353 fG >= 0.0f &&
fG <= 1.0f &&
354 fB >= 0.0f &&
fB <= 1.0f;
399 return { 0, 0, 0, 0 };
401 float invAlpha = 1 /
fA;
402 return {
fR * invAlpha,
fG * invAlpha,
fB * invAlpha,
fA };
416 return {
fR,
fG,
fB, 1.0f };
430template <>
SK_API uint32_t SkColor4f::toBytes_RGBA()
const;
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorLTGRAY
#define SkColorGetR(color)
constexpr SkColor SK_ColorMAGENTA
#define SkColorGetG(color)
SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
SK_API SkPMColor SkPreMultiplyColor(SkColor c)
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorTRANSPARENT
SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
constexpr SkAlpha SK_AlphaOPAQUE
SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static void SkColorToHSV(SkColor color, SkScalar hsv[3])
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
@ kRGB_SkColorChannelFlags
@ kRGBA_SkColorChannelFlags
@ kRed_SkColorChannelFlag
@ kGrayAlpha_SkColorChannelFlags
@ kRG_SkColorChannelFlags
@ kGreen_SkColorChannelFlag
@ kAlpha_SkColorChannelFlag
@ kGray_SkColorChannelFlag
@ kBlue_SkColorChannelFlag
#define SkColorGetB(color)
constexpr SkColor SK_ColorWHITE
constexpr SkAlpha SK_AlphaTRANSPARENT
constexpr SkColor SK_ColorDKGRAY
constexpr SkColor4f kLtGray
constexpr SkColor4f kMagenta
constexpr SkColor4f kGreen
constexpr SkColor4f kWhite
constexpr SkColor4f kCyan
constexpr SkColor4f kTransparent
constexpr SkColor4f kBlack
constexpr SkColor4f kGray
constexpr SkColor4f kBlue
constexpr SkColor4f kYellow
constexpr SkColor4f kDkGray
const float * vec() const
SkColor toSkColor() const
SkRGBA4f< kPremul_SkAlphaType > premul() const
SkRGBA4f operator*(float scale) const
SkRGBA4f operator*(const SkRGBA4f &scale) const
static SkRGBA4f FromBytes_RGBA(uint32_t color)
bool operator!=(const SkRGBA4f &other) const
bool operator==(const SkRGBA4f &other) const
SkRGBA4f< kUnpremul_SkAlphaType > unpremul() const
std::array< float, 4 > array() const
SkRGBA4f makeOpaque() const
uint32_t toBytes_RGBA() const
static SkRGBA4f FromColor(SkColor color)
float operator[](int index) const
static SkRGBA4f FromPMColor(SkPMColor)
float & operator[](int index)