28#include <SFML/Graphics/Color.hpp>
78 r =
static_cast<Uint8
>(std::min(
r + Other.
r, 255));
79 g =
static_cast<Uint8
>(std::min(
g + Other.
g, 255));
80 b =
static_cast<Uint8
>(std::min(
b + Other.
b, 255));
81 a =
static_cast<Uint8
>(std::min(
a + Other.
a, 255));
92 r =
static_cast<Uint8
>(
r * Other.
r / 255);
93 g =
static_cast<Uint8
>(
g * Other.
g / 255);
94 b =
static_cast<Uint8
>(
b * Other.
b / 255);
95 a =
static_cast<Uint8
>(
a * Other.
a / 255);
106 return (
r == Other.
r) && (
g == Other.
g) && (
b == Other.
b) && (
a == Other.
a);
115 return (
r != Other.
r) || (
g != Other.
g) || (
b != Other.
b) || (
a != Other.
a);
134Color operator *(
const Color& Color1,
const Color& Color2)
Color is an utility class for manipulating 32-bits RGBA colors.
Color & operator*=(const Color &Other)
Operator *= overload to modulate a color.
static const Color Red
Red predefined color.
static const Color White
White predefined color.
Uint8 a
Alpha (transparency) component.
static const Color Cyan
Cyan predefined color.
static const Color Magenta
Magenta predefined color.
static const Color Black
Black predefined color.
static const Color Green
Green predefined color.
bool operator==(const Color &Other) const
Compare two colors (for equality).
static const Color Blue
Blue predefined color.
Color & operator+=(const Color &Other)
Operator += overload to add a color.
Color()
Default constructor.
bool operator!=(const Color &Other) const
Compare two colors (for difference).
static const Color Yellow
Yellow predefined color.