Twinside / Rasterific

A drawing engine in Haskell
BSD 3-Clause "New" or "Revised" License
140 stars 11 forks source link

Opacity problem in Gradients #11

Closed jeffreyrosenbluth closed 10 years ago

jeffreyrosenbluth commented 10 years ago

Take a look at the image image generated by

import Codec.Picture( PixelRGBA8( .. ), writePng )
import Graphics.Rasterific
import Graphics.Rasterific.Texture

main :: IO ()
main = do
  let white = PixelRGBA8 255 255 255 255
      img = withTexture (withSampler SamplerPad
                        (linearGradientTexture gradDef
                        (V2 40 40) (V2 130 130))) $
                        fill $ circle (V2 100 100) 100
      gradDef = [(0, PixelRGBA8 0 0x86 0xc1 255)
                ,(0.5, PixelRGBA8 0xff 0xf4 0xc1 255)
                ,(1, PixelRGBA8 0xFF 0x53 0x73 50)]
  writePng "yourimage.png" (renderDrawing 400 200 white img)
Twinside commented 10 years ago

Thanks, I'll look into it