diff options
| author | Mike Wey | 2011-10-16 19:40:07 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-10-16 19:40:07 +0200 |
| commit | d131ed5959a916a0180bdb561ef508f51e19d8a7 (patch) | |
| tree | fa9f0ffbb7f9a242a208589768ff4c52014350fc /dmagick/Color.d | |
| parent | 20aceb391b4ba13d9f670cefa62066ab2ab5b90a (diff) | |
Allow converting one color type to an other.
Diffstat (limited to 'dmagick/Color.d')
| -rw-r--r-- | dmagick/Color.d | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dmagick/Color.d b/dmagick/Color.d index 7223d81..2ddaa64 100644 --- a/dmagick/Color.d +++ b/dmagick/Color.d @@ -130,6 +130,18 @@ class Color } /** + * Support casting between different colors. + * You can also use std.conv.to + */ + T opCast(T : Color)() + { + T color = new T(); + color.packet = packet; + + return color; + } + + /** * The value for red in the range [0 .. QuantumRange] */ void redQuantum(Quantum red) |
