diff --git a/src/basics.cc b/src/basics.cc index b0c21da..7f8b114 100644 --- a/src/basics.cc +++ b/src/basics.cc @@ -279,12 +279,22 @@ Color::Color() { } +/* + * Color::Color -- + * + * Constructor. Create a new Color with the given RGB components. Alpha is 1.0. + */ +Color::Color(const float &r, const float &g, const float &b) + : Color(r, g, b, 1.0) +{ } + + /* * Color::Color -- * * Constructor. Create a new Color with the given components. */ -Color::Color(float r, float g, float b, float a) +Color::Color(const float &r, const float &g, const float &b, const float &a) : red(r), green(g), blue(b), alpha(a) { } diff --git a/src/basics.h b/src/basics.h index c960281..38bdbeb 100644 --- a/src/basics.h +++ b/src/basics.h @@ -58,7 +58,8 @@ struct Ray struct Color { Color(); - Color(float r, float g, float b, float a); + Color(const float &r, const float &g, const float &b); + Color(const float &r, const float &g, const float &b, const float &a); Color &operator*=(const float &rhs); Color &operator/=(const float &rhs);