From: Justin Bl Date: 2009-08-10T01:40:13+09:00 Subject: Re: Imagemagick, Rmagick hsla problem Tim, Thanks very much for your help. The code you posted works. Tim Hunter wrote: > Justin Bl wrote: >>> irb(main):001:0> p = Magick::Pixel.from_hsla(80, 100, 50, 1) >> require 'rubygems' >> #@canvas.colorspace = HSLColorspace >> >> $colors = Array.new >> # convert it to array of pixels >> puts $colors[0].class >> >> img = MyImage.new("hsl_test", x, y) >> img.draw() >> img.finalize('png') > > The color of a new image is set when the image is created. Do this: > > @canvas = Magick::Image.new(@width, @height) do > self.background_color = Magick::Pixel.from_hsla(80, 100, 50, 1) > end > > Setting the background_color attribute *after* creating the image only > changes the value of the background_color attribute. It doesn't actually > change the color of the image. -- Posted via http://www.ruby-forum.com/.