[cairo-commit] rcairo/test test_color.rb,NONE,1.1

Kouhei Sutou commit at pdx.freedesktop.org
Sun Jan 10 18:08:05 PST 2010


Committed by: kou

Update of /cvs/cairo/rcairo/test
In directory kemper:/tmp/cvs-serv21907/test

Added Files:
	test_color.rb 
Log Message:
* src/lib/cairo/color.rb(Color::RGB#to_hsv): fix RGB -> HSV conversion.
  Patch by Yuta Taniguchi. Thanks!!!
* README: add Yuta Taniguchi to thanks list. Thanks!!!

* test/test_color.rb: add.


--- NEW FILE: test_color.rb ---
require 'cairo'

class ColorTest < Test::Unit::TestCase
  def test_rgb_to_hsv
    color = rgb(0.3, 0.5, 0.75)
    assert_equal(color, color.to_hsv.to_rgb)
  end

  private
  def rgb(r, g, b)
    Cairo::Color::RGB.new(r, g, b)
  end

  def hsv(h, s, v)
    Cairo::Color::HSV.new(h, s, v)
  end
end



More information about the cairo-commit mailing list