Visual Computing Library
|
The Color class represents a RGBA color that will be part of an Element (e.g. Vertex, Face, ...) or Mesh. More...
#include <vclib/mesh/components/color.h>
Public Types | |
using | ColorType = vcl::Color |
Expose the type of the Color. | |
Public Member Functions | |
Color ()=default | |
Initilizes the color to black (with alpha 255). | |
const vcl::Color & | color () const |
Returns a const reference of the color of the element. | |
vcl::Color & | color () |
Returns a reference pf the color of the element. | |
Protected Member Functions | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
Private Types | |
using | Base = Component< Color< ParentElemType, OPT >, CompId::COLOR, vcl::Color, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT > |
The Color class represents a RGBA color that will be part of an Element (e.g. Vertex, Face, ...) or Mesh.
Allows to get and set an object of type Color.
For example, if you have a Vertex Element v
with the Color component, you'll be able to access to this component member functions from v
:
ParentElemType | This template argument must be void if the component needs to be stored horizontally, or the type of the parent element that will contain this component if the component needs to be stored vertically. |
OPT | If true, the component will be optional. This argument is considered only if the component is stored vertically. |
|
inline |
Returns a reference pf the color of the element.
|
inline |
Returns a const reference of the color of the element.