From 206c0a9adc9a4926cd3195b0f475428c9c7442c1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Fri, 13 May 2016 12:47:53 +0200 Subject: [PATCH] Core/Color: Add IsOpaque method Former-commit-id: b730460b9d81adbcee983648145cbc7a97301329 --- include/Nazara/Core/Color.hpp | 2 ++ include/Nazara/Core/Color.inl | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/Nazara/Core/Color.hpp b/include/Nazara/Core/Color.hpp index 91a8cc43d..5fef4f854 100644 --- a/include/Nazara/Core/Color.hpp +++ b/include/Nazara/Core/Color.hpp @@ -25,6 +25,8 @@ namespace Nz inline Color(const Color& color) = default; inline ~Color() = default; + inline bool IsOpaque() const; + inline String ToString() const; inline Color operator+(const Color& angles) const; diff --git a/include/Nazara/Core/Color.inl b/include/Nazara/Core/Color.inl index 4ac3a2246..5d71393df 100644 --- a/include/Nazara/Core/Color.inl +++ b/include/Nazara/Core/Color.inl @@ -72,6 +72,15 @@ namespace Nz { } + /*! + * \brief Return true is the color has no degree of transparency + * \return true if the color has an alpha value of 255 + */ + inline bool Color::IsOpaque() const + { + return a == 255; + } + /*! * \brief Converts this to string * \return String representation of the object "Color(r, g, b[, a])"