    {-# OPTIONS_HADDOCK hide #-}

    module Graphics.Gloss.Internals.Rendering.Color where
    import Graphics.Gloss.Internals.Data.Color
    import Unsafe.Coerce
    import qualified Graphics.Rendering.OpenGL.GL           as GL

    -- | Convert one of our Colors to OpenGL's representation.
    glColor4OfColor :: Color -> GL.Color4 a
    glColor4OfColor :: forall a. Color -> Color4 a
    glColor4OfColor Color
    color
     = case Color
    color of
            RGBA Float
    r Float
    g Float
    b Float
    a
             -> let rF :: b
    rF      = Float -> b
    forall a b. a -> b
    unsafeCoerce Float
    r
                    gF :: b
    gF      = Float -> b
    forall a b. a -> b
    unsafeCoerce Float
    g
                    bF :: b
    bF      = Float -> b
    forall a b. a -> b
    unsafeCoerce Float
    b
                    aF :: b
    aF      = Float -> b
    forall a b. a -> b
    unsafeCoerce Float
    a
                in  a -> a -> a -> a -> Color4 a
    forall a. a -> a -> a -> a -> Color4 a
    GL.Color4 a
    forall {b}. b
    rF a
    forall {b}. b
    gF a
    forall {b}. b
    bF a
    forall {b}. b
    aF
    {-# INLINE glColor4OfColor #-}