From 0b7d66fea114d6bc45586a8c62cd98df4ee7d507 Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Mon, 15 Aug 2011 22:02:15 +0200 Subject: Add ColorGray for grayscale colors. --- dmagick/ColorRGB.d | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'dmagick/ColorRGB.d') diff --git a/dmagick/ColorRGB.d b/dmagick/ColorRGB.d index 1cbd48d..80c85f9 100644 --- a/dmagick/ColorRGB.d +++ b/dmagick/ColorRGB.d @@ -26,12 +26,10 @@ class ColorRGB : Color */ this(ubyte red, ubyte green, ubyte blue, ubyte opacity = 0) { - super(); - - pixelPacket.red = ScaleCharToQuantum(red); - pixelPacket.green = ScaleCharToQuantum(green); - pixelPacket.blue = ScaleCharToQuantum(blue); - pixelPacket.opacity = ScaleCharToQuantum(opacity); + super(ScaleCharToQuantum(red), + ScaleCharToQuantum(green), + ScaleCharToQuantum(blue), + ScaleCharToQuantum(opacity)); } /** @@ -40,12 +38,10 @@ class ColorRGB : Color */ this(double red, double green, double blue, double opacity = 0) { - super(); - - pixelPacket.red = scaleDoubleToQuantum(red); - pixelPacket.green = scaleDoubleToQuantum(green); - pixelPacket.blue = scaleDoubleToQuantum(blue); - pixelPacket.opacity = scaleDoubleToQuantum(opacity); + super(scaleDoubleToQuantum(red), + scaleDoubleToQuantum(green), + scaleDoubleToQuantum(blue), + scaleDoubleToQuantum(opacity)); } /** -- cgit v1.2.3