Mercurial > projects > doodle
comparison doodle/tk/color.d @ 101:523269b36711
Update to dmd 2.050
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Thu, 28 Oct 2010 16:35:11 +1030 |
parents | 535bae7a7305 |
children | bc5baa585b32 |
comparison
equal
deleted
inserted
replaced
100:a274d16ab6ce | 101:523269b36711 |
---|---|
1 module doodle.tk.color; | 1 module doodle.tk.color; |
2 | 2 |
3 struct Color { | 3 struct Color { |
4 static immutable Color DEFAULT = Color(0.0, 0.0, 0.0, 1.0); | |
5 | |
6 this(in double r, in double g, in double b, in double a) { | 4 this(in double r, in double g, in double b, in double a) { |
7 // XXX how to deal with out of range? Clamp/assert | 5 // XXX how to deal with out of range? Clamp/assert |
8 _r = r; | 6 _r = r; |
9 _g = g; | 7 _g = g; |
10 _b = b; | 8 _b = b; |
18 double g() const { return _g; } | 16 double g() const { return _g; } |
19 double b() const { return _b; } | 17 double b() const { return _b; } |
20 double a() const { return _a; } | 18 double a() const { return _a; } |
21 | 19 |
22 private { | 20 private { |
23 double _r, _g, _b, _a; | 21 double _r = 0.0, _g = 0.0, _b = 0.0, _a = 1.0; |
24 } | 22 } |
25 } | 23 } |