diff --git a/Graphics/GD.hsc b/Graphics/GD.hsc
--- a/Graphics/GD.hsc
+++ b/Graphics/GD.hsc
@@ -1,3 +1,4 @@
+{-# LANGUAGE EmptyDataDecls #-}
 module Graphics.GD (
                     -- * Types
                     Image, Size, Point, Color,
@@ -37,20 +38,20 @@
                     drawString, measureString,
                     drawStringCircle,
                     -- * Colors
-                    rgb, rgba
+                    rgb, rgba, toRGBA
                    ) where
 
 import           Control.Exception        (bracket)
 import           Control.Monad            (liftM, unless)
+import           Data.Bits
 import qualified Data.ByteString.Internal as B
 import           Foreign                  (Ptr,FunPtr,ForeignPtr)
 import           Foreign                  (peekByteOff)
 import qualified Foreign                  as F
-import           Foreign                  ((.|.))
 import           Foreign.C                (CInt,CString,CDouble)
 import qualified Foreign.C                as C
 
-data CFILE = CFILE
+data CFILE
 
 foreign import ccall "stdio.h fopen" c_fopen
     :: CString -> CString -> IO (Ptr CFILE)
@@ -71,7 +72,7 @@
 #include <gd.h>
 #include "gd-extras.h"
 
-data GDImage = GDImage
+data GDImage
 
 -- JPEG format
 
@@ -191,6 +192,15 @@
 
 foreign import ccall "gd.h &gdFree" gdFree
     :: FunPtr (Ptr a -> IO ())
+    
+toRGBA :: Color -> (Int, Int, Int, Int) 
+toRGBA c = (fromIntegral r, fromIntegral g, fromIntegral b, fromIntegral a)
+ where
+   b = c `mod` byte
+   g = shiftR c 8 `mod` byte
+   r = shiftR c 16 `mod` byte
+   a = shiftR c 24 `mod` byte
+   byte = 2 ^ (8::Int)
 
 -- We use a second level of indirection to allow storing a null pointer
 -- when the image has already been freed. This allows 'withImage' to 
diff --git a/Graphics/GD/ByteString.hs b/Graphics/GD/ByteString.hs
--- a/Graphics/GD/ByteString.hs
+++ b/Graphics/GD/ByteString.hs
@@ -40,7 +40,7 @@
                     measureString,
                     drawStringCircle,
                     -- * Colors
-                    GD.rgb, GD.rgba
+                    GD.rgb, GD.rgba, GD.toRGBA
                    ) where
 
 import           Graphics.GD.Internal     (Point,Color,Image,GDImage,CFILE,Size)
diff --git a/Graphics/GD/ByteString/Lazy.hs b/Graphics/GD/ByteString/Lazy.hs
--- a/Graphics/GD/ByteString/Lazy.hs
+++ b/Graphics/GD/ByteString/Lazy.hs
@@ -40,7 +40,7 @@
                     measureString,
                     drawStringCircle,
                     -- * Colors
-                    GD.rgb, GD.rgba
+                    GD.rgb, GD.rgba, GD.toRGBA
                    ) where
 
 import           Graphics.GD.Internal     (Point,Color,Image,GDImage,CFILE,Size)
diff --git a/Graphics/GD/Internal.hsc b/Graphics/GD/Internal.hsc
--- a/Graphics/GD/Internal.hsc
+++ b/Graphics/GD/Internal.hsc
@@ -2,9 +2,10 @@
 
 import           Control.Exception (bracket)
 import           Control.Monad     (liftM, unless)
+import           Data.Bits
 import           Foreign           (Ptr,FunPtr,ForeignPtr)
+import           Foreign           (peek,peekByteOff)
 import qualified Foreign           as F
-import           Foreign           (peek,peekByteOff,(.|.))
 import           Foreign.C         (CDouble,CInt,CString)
 import qualified Foreign.C         as C
 
@@ -371,6 +372,15 @@
     (int r `F.shiftL` 16) .|.
     (int g `F.shiftL` 8)  .|.
     int b
+    
+toRGBA :: Color -> (Int, Int, Int, Int) 
+toRGBA c = (fromIntegral r, fromIntegral g, fromIntegral b, fromIntegral a)
+ where
+   b = c `mod` byte
+   g = shiftR c 8 `mod` byte
+   r = shiftR c 16 `mod` byte
+   a = shiftR c 24 `mod` byte
+   byte = 2 ^ (8::Int)
 
 --
 -- * Text
diff --git a/gd.cabal b/gd.cabal
--- a/gd.cabal
+++ b/gd.cabal
@@ -1,7 +1,7 @@
 Name: gd
 Category: Graphics
 License-File: LICENSE
-Version: 3000.5.0
+Version: 3000.6
 Cabal-version: >= 1.2
 Build-type: Simple
 Copyright: Bjorn Bringert
