X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fcolour.h;h=241f7384035fbf2e11f8d53629314788c7eeb996;hb=607ba59181708568c23295aa1069ebbfc78f2e9c;hp=4989277400ca2c083b4470daa2d93535874edbe7;hpb=38a5ff713757b9dc0cb67cb09613182c46dc9657;p=libsub.git diff --git a/src/colour.h b/src/colour.h index 4989277..241f738 100644 --- a/src/colour.h +++ b/src/colour.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,13 +17,21 @@ */ +/** @file src/colour.h + * @brief Colour class. + */ + #ifndef LIBSUB_COLOUR_H #define LIBSUB_COLOUR_H #include +#include namespace sub { +/** @class Colour + * @brief An RGB colour. + */ class Colour { public: @@ -32,14 +40,15 @@ public: , g (0) , b (0) {} - + Colour (float r, float g, float b) : r (r) , g (g) , b (b) {} - Colour (std::string); + static Colour from_rgba_hex(std::string); + static Colour from_rgb_hex (std::string); /** red component (from 0 to 1) */ float r; @@ -51,7 +60,7 @@ public: bool operator== (Colour const & a, Colour const & b); - + } #endif