Sha256: 8a3d04ffab926e1c981dde4d07da34b6fde34b173485e7dea1b3fbf6ecab1532

Contents?: true

Size: 1.39 KB

Versions: 151

Compression:

Stored size: 1.39 KB

Contents

describe "UIImage#color_at" do
  before do
    @image = 'little_square'.uiimage
  end

  describe "should return white at the corners" do
    it "top_left" do
      color = @image.color_at([0, 0])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "top_right" do
      color = @image.color_at([9, 0])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "bottom_left" do
      color = @image.color_at([0, 9])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
    it "bottom_right" do
      color = @image.color_at([9, 9])
      color.red.should == 1
      color.green.should == 1
      color.blue.should == 1
    end
  end

  describe "should return blue at the center" do
    it "3,3" do
      color = @image.color_at([3, 3])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "4,4" do
      color = @image.color_at([4, 4])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "5,5" do
      color = @image.color_at([5, 5])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
    it "6,6" do
      color = @image.color_at([6, 6])
      color.red.should == 0
      color.green.should == 0
      color.blue.should == 1
    end
  end
end

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
sugarcube-0.20.0 spec/uiimage_color_at_spec.rb
sugarcube-0.19.5 spec/uiimage_color_at_spec.rb
sugarcube-0.19.4 spec/uiimage_color_at_spec.rb
sugarcube-0.19.2 spec/uiimage_color_at_spec.rb
sugarcube-0.19.0 spec/uiimage_color_at_spec.rb
sugarcube-0.18.21 spec/uiimage_color_at_spec.rb
sugarcube-0.18.20 spec/uiimage_color_at_spec.rb
sugarcube-0.18.19 spec/uiimage_color_at_spec.rb
sugarcube-0.18.18 spec/uiimage_color_at_spec.rb
sugarcube-0.18.17 spec/uiimage_color_at_spec.rb
sugarcube-0.18.16 spec/uiimage_color_at_spec.rb
sugarcube-0.18.12 spec/uiimage_color_at_spec.rb
sugarcube-0.18.11 spec/uiimage_color_at_spec.rb
sugarcube-0.18.10 spec/uiimage_color_at_spec.rb
sugarcube-0.18.9 spec/uiimage_color_at_spec.rb
sugarcube-0.18.8 spec/uiimage_color_at_spec.rb
sugarcube-0.18.7 spec/uiimage_color_at_spec.rb
sugarcube-0.18.6 spec/uiimage_color_at_spec.rb
sugarcube-0.18.5 spec/uiimage_color_at_spec.rb
sugarcube-0.18.4 spec/uiimage_color_at_spec.rb