From: Ricardo Cruz Date: Sat, 21 Aug 2004 11:39:59 +0000 (+0000) Subject: Allow creation of a Color object feeding with a vector of Uints. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4adec13cbf57960a4106b5140d52c14d0283eed3;p=supertux.git Allow creation of a Color object feeding with a vector of Uints. SVN-Revision: 1820 --- diff --git a/lib/video/screen.h b/lib/video/screen.h index a1797fee3..93c0bfae7 100644 --- a/lib/video/screen.h +++ b/lib/video/screen.h @@ -26,6 +26,8 @@ #endif #include +#include + namespace SuperTux { @@ -42,6 +44,11 @@ namespace SuperTux : red(red_), green(green_), blue(blue_), alpha(alpha_) {} + Color(std::vector color) + : red(0), green(0), blue(0), alpha(255) + { if(color.size() >= 3) { red = color[0]; green = color[1]; blue = color[2]; } + if(color.size() == 4) alpha = color[3]; } + Color(const Color& o) : red(o.red), green(o.green), blue(o.blue), alpha(o.alpha) { }