5#ifndef FLUTTER_DISPLAY_LIST_DL_COLOR_H_
6#define FLUTTER_DISPLAY_LIST_DL_COLOR_H_
14 constexpr DlColor() : argb_(0xFF000000) {}
38 constexpr int getAlpha()
const {
return argb_ >> 24; }
39 constexpr int getRed()
const {
return (argb_ >> 16) & 0xFF; }
40 constexpr int getGreen()
const {
return (argb_ >> 8) & 0xFF; }
41 constexpr int getBlue()
const {
return argb_ & 0xFF; }
53 return (argb_ & 0xFF000000) |
60 return DlColor((argb_ & 0x00FFFFFF) | (alpha << 24));
63 return DlColor((argb_ & 0xFF00FFFF) | (red << 16));
66 return DlColor((argb_ & 0xFFFF00FF) | (green << 8));
69 return DlColor((argb_ & 0xFFFFFF00) | (blue << 0));
74 : opacity >= 1 ? *this
78 constexpr uint32_t
argb()
const {
return argb_; }
82 bool operator==(uint32_t
const& other)
const {
return argb_ == other; }
83 bool operator!=(uint32_t
const& other)
const {
return argb_ != other; }
88 static float toF(uint8_t comp) {
return comp * (1.0f / 255); }
89 static uint8_t toC(
float fComp) {
return round(fComp * 255); }
static void round(SkPoint *p)
constexpr DlColor modulateOpacity(float opacity) const
static constexpr DlColor kMagenta()
constexpr float getAlphaF() const
static constexpr DlColor kWhite()
static constexpr DlColor kBlue()
constexpr int getRed() const
constexpr DlColor(uint32_t argb)
constexpr int getGreen() const
static constexpr DlColor kBlack()
static constexpr DlColor kYellow()
constexpr DlColor withGreen(uint8_t green) const
static constexpr uint8_t toAlpha(SkScalar opacity)
static constexpr DlColor kLightGrey()
static constexpr SkScalar toOpacity(uint8_t alpha)
constexpr DlColor withAlpha(uint8_t alpha) const
constexpr float getRedF() const
constexpr uint32_t premultipliedArgb() const
bool operator==(DlColor const &other) const
bool operator!=(uint32_t const &other) const
static constexpr DlColor kMidGrey()
constexpr int getBlue() const
static constexpr DlColor kTransparent()
static constexpr DlColor kRed()
constexpr float getBlueF() const
static constexpr DlColor kGreen()
bool operator==(uint32_t const &other) const
constexpr bool isTransparent() const
static constexpr DlColor kDarkGrey()
static constexpr DlColor kCyan()
constexpr uint32_t argb() const
bool operator!=(DlColor const &other) const
constexpr DlColor withBlue(uint8_t blue) const
constexpr float getGreenF() const
constexpr int getAlpha() const
constexpr DlColor withRed(uint8_t red) const
constexpr bool isOpaque() const