Added operator - for sf::Color (#114)

This commit is contained in:
Laurent Gomila 2013-08-09 14:57:32 +02:00
parent c697623689
commit 6d4c844959
2 changed files with 56 additions and 8 deletions

View file

@ -126,6 +126,21 @@ SFML_GRAPHICS_API bool operator !=(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Color operator +(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// \relates Color
/// \brief Overload of the binary - operator
///
/// This operator returns the component-wise subtraction of two colors.
/// Components below 0 are clamped to 0.
///
/// \param left Left operand
/// \param right Right operand
///
/// \return Result of \a left - \a right
///
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Color operator -(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// \relates Color
/// \brief Overload of the binary * operator
@ -159,6 +174,22 @@ SFML_GRAPHICS_API Color operator *(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Color& operator +=(Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// \relates Color
/// \brief Overload of the binary -= operator
///
/// This operator computes the component-wise subtraction of two colors,
/// and assigns the result to the left operand.
/// Components below 0 are clamped to 0.
///
/// \param left Left operand
/// \param right Right operand
///
/// \return Reference to \a left
///
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Color& operator -=(Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// \relates Color
/// \brief Overload of the binary *= operator