Node: Color Operators, Next: , Previous: Color Constructors and Setting Functions, Up: Color Reference



Operators

void operator= (const Color& c) Assignment operator
Sets name to the empty string, use_name to false, and red_part, green_part, and blue_part to c.red_part, c.green_part, and c.blue_part, respectively.

bool operator== (const Color& c) const operator
Equality operator. Returns true, if the red_parts, green_parts, and blue_parts of *this and c are equal, otherwise false. The names and use_names are not compared.

bool operator!= (const Color& c) const operator
Inequality operator. Returns false, if the red_parts, green_parts, and blue_parts of *this and c are equal, otherwise true. The names and use_names are not compared.

ostream& operator<< (ostream& o, const Color& c) Non-member function
Output operator. Writes the MetaPost code for the Color to out_stream when a Picture is output. This occurs when the Color has been used as an argument to drawing or filling functions.

If use_name is true, name is written to out_stream. Otherwise, "(red_part, green_part, blue_part)" is written to out_stream.