5#ifndef FLUTTER_DISPLAY_LIST_DL_COLOR_H_
6#define FLUTTER_DISPLAY_LIST_DL_COLOR_H_
14 constexpr DlColor() : argb_(0xFF000000) {}
42 constexpr int getAlpha()
const {
return argb_ >> 24; }
43 constexpr int getRed()
const {
return (argb_ >> 16) & 0xFF; }
44 constexpr int getGreen()
const {
return (argb_ >> 8) & 0xFF; }
45 constexpr int getBlue()
const {
return argb_ & 0xFF; }
57 return (argb_ & 0xFF000000) |
64 return DlColor((argb_ & 0x00FFFFFF) | (alpha << 24));
67 return DlColor((argb_ & 0xFF00FFFF) | (red << 16));
70 return DlColor((argb_ & 0xFFFF00FF) | (green << 8));
73 return DlColor((argb_ & 0xFFFFFF00) | (blue << 0));
78 : opacity >= 1 ? *this
82 constexpr uint32_t
argb()
const {
return argb_; }
86 bool operator==(uint32_t
const& other)
const {
return argb_ == other; }
87 bool operator!=(uint32_t
const& other)
const {
return argb_ != other; }
92 static float toF(uint8_t comp) {
return comp * (1.0f / 255); }
93 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 kMaroon()
static constexpr DlColor kYellow()
constexpr DlColor withGreen(uint8_t green) const
static constexpr uint8_t toAlpha(SkScalar opacity)
static constexpr DlColor kFuchsia()
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 kAliceBlue()
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
static constexpr DlColor kSkyBlue()
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