1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00

fix(color): Rename type() function to get_type

In gcc5, this caused compilation errors because the type enum has the
same name.
This commit is contained in:
patrick96 2021-02-23 09:53:54 +01:00 committed by Patrick Ziegler
parent cf2653c8bd
commit 3f03b671bb
3 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ class rgba {
bool operator==(const rgba& other) const; bool operator==(const rgba& other) const;
uint32_t value() const; uint32_t value() const;
type type() const; type get_type() const;
double alpha_d() const; double alpha_d() const;
double red_d() const; double red_d() const;

View file

@ -106,7 +106,7 @@ uint32_t rgba::value() const {
return this->m_value; return this->m_value;
} }
enum rgba::type rgba::type() const { enum rgba::type rgba::get_type() const {
return m_type; return m_type;
} }

View file

@ -12,7 +12,7 @@ TEST(Rgba, constructor) {
EXPECT_FALSE(rgba("#-abc").has_color()); EXPECT_FALSE(rgba("#-abc").has_color());
EXPECT_FALSE(rgba("#xyz").has_color()); EXPECT_FALSE(rgba("#xyz").has_color());
EXPECT_EQ(rgba::type::ALPHA_ONLY, rgba{"#12"}.type()); EXPECT_EQ(rgba::type::ALPHA_ONLY, rgba{"#12"}.get_type());
EXPECT_EQ(0xff000000, rgba{"#ff"}.value()); EXPECT_EQ(0xff000000, rgba{"#ff"}.value());