From 9f6a311c076df74eb7eb2d2850fb29f8f636c1d7 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: 4e9dd99525a550af90a1de1a8c86e3120e33a5de --- 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])"