47 Color(
float red,
float green,
float blue,
float alpha=1.0);
53 Color(
const std::vector<float> &vals);
Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...
float & operator[](const int i)
Accesses the ith coordinate of the color, stored in RGBA order.
bool operator==(const Color &p) const
Check for equality.
Color(const std::vector< float > &vals)
Constructs a point given a 3 or 4-element vector of floats.
Color(float red, float green, float blue, float alpha=1.0)
Constructs a color. Alpha defaults to 1.0 (completely opaque)
static Color Lerp(const Color &a, const Color &b, float alpha)
Linear interpolation between two colors. Alpha=0.0 returns 'a' and alpha=1.0 returns 'b',...
const float * value_ptr() const
Returns a const pointer to the raw data array.
float operator[](const int i) const
Accesses the ith component of the color, stored in RGBA order.
virtual ~Color()
Color destructor.
Color()
Defaults to black.
Color(float *p)
Constructs a point given a pointer to float array.
Color Lerp(const Color &b, float alpha) const
Linear interpolation between this color and another. Alpha=0.0 returns this color,...
Color(const Color &p)
Copy constructor.
bool operator!=(const Color &p) const
Check for inequality.
Color & operator=(const Color &p)
Assignment operator.
std::vector< float > ToVector() const
Namespace for the MinGfx Toolkit.
std::ostream & operator<<(std::ostream &os, const Color &c)
std::istream & operator>>(std::istream &is, Color &c)