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;
uint32_t value() const;
type type() const;
type get_type() const;
double alpha_d() const;
double red_d() const;

View File

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

View File

@ -12,7 +12,7 @@ TEST(Rgba, constructor) {
EXPECT_FALSE(rgba("#-abc").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());