* mln/literal/colors.hh,
* mln/value/rgb.hh:
Add literal::dark_red and literal::dark_orange.
---
milena/ChangeLog | 8 ++++++++
milena/mln/literal/colors.hh | 18 ++++++++++++++++++
milena/mln/value/rgb.hh | 22 ++++++++++++++++++++++
3 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 069fe9b..5fa5495 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2008-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add new colors.
+
+ * mln/literal/colors.hh,
+ * mln/value/rgb.hh:
+ Add literal::dark_red and literal::dark_orange.
+
+2008-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add new methods to box.
* mln/core/site_set/box.hh: add crop_wrt(), nrows() and ncols.
diff --git a/milena/mln/literal/colors.hh b/milena/mln/literal/colors.hh
index a006dc1..069ae59 100644
--- a/milena/mln/literal/colors.hh
+++ b/milena/mln/literal/colors.hh
@@ -51,6 +51,16 @@ namespace mln
{
};
+ /// Type of literal dark red.
+ struct dark_red_t : public Literal<dark_red_t>
+ {
+ };
+
+ /// Type of literal dark orange.
+ struct dark_orange_t : public Literal<dark_orange_t>
+ {
+ };
+
/// Type of literal green.
struct green_t : public Literal<green_t>
{
@@ -61,6 +71,14 @@ namespace mln
// FIXME: Make this a proper global (issue #43).
static const red_t red = red_t();
+ /// Literal dark red.
+ // FIXME: Make this a proper global (issue #43).
+ static const dark_red_t dark_red = dark_red_t();
+
+ /// Literal red.
+ // FIXME: Make this a proper global (issue #43).
+ static const dark_orange_t dark_orange = dark_orange_t();
+
/// Literal green.
// FIXME: Make this a proper global (issue #43).
static const green_t green = green_t();
diff --git a/milena/mln/value/rgb.hh b/milena/mln/value/rgb.hh
index eed8c5a..1e3d7ca 100644
--- a/milena/mln/value/rgb.hh
+++ b/milena/mln/value/rgb.hh
@@ -56,6 +56,8 @@ namespace mln
struct white_t;
struct red_t;
+ struct dark_red_t;
+ struct dark_orange_t;
struct blue_t;
struct green_t;
/// \}
@@ -204,6 +206,8 @@ namespace mln
rgb<n>(const mln::literal::blue_t&);
rgb<n>(const mln::literal::red_t&);
+ rgb<n>(const mln::literal::dark_red_t&);
+ rgb<n>(const mln::literal::dark_orange_t&);
rgb<n>(const mln::literal::green_t&);
/// \}
@@ -366,6 +370,24 @@ namespace mln
template <unsigned n>
inline
+ rgb<n>::rgb(const mln::literal::dark_red_t&)
+ {
+ this->v_[0] = mln_max(int_u<n>) / 3;
+ this->v_[1] = 0;
+ this->v_[2] = 0;
+ }
+
+ template <unsigned n>
+ inline
+ rgb<n>::rgb(const mln::literal::dark_orange_t&)
+ {
+ this->v_[0] = mln_max(int_u<n>) / 3;
+ this->v_[1] = mln_max(int_u<n>) / 3;
+ this->v_[2] = 0;
+ }
+
+ template <unsigned n>
+ inline
rgb<n>::rgb(const mln::literal::green_t&)
{
this->v_[0] = 0;
--
1.5.6.5