From 4adec13cbf57960a4106b5140d52c14d0283eed3 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Sat, 21 Aug 2004 11:39:59 +0000 Subject: [PATCH] Allow creation of a Color object feeding with a vector of Uints. SVN-Revision: 1820 --- lib/video/screen.h | 7 +++++++ 1 file changed, 7 insertions(+) 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) { } -- 2.11.0