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-3.0.4 spec/ios/image_color_at_spec.rb
sugarcube-3.0.3 spec/ios/image_color_at_spec.rb
sugarcube-3.0.2 spec/ios/image_color_at_spec.rb
sugarcube-3.0.1 spec/ios/image_color_at_spec.rb
sugarcube-3.0.0 spec/ios/image_color_at_spec.rb
sugarcube-2.12.3 spec/ios/image_color_at_spec.rb
sugarcube-2.12.2 spec/ios/image_color_at_spec.rb
sugarcube-2.12.1 spec/ios/image_color_at_spec.rb
sugarcube-2.12.0 spec/ios/image_color_at_spec.rb
sugarcube-2.11.1 spec/ios/image_color_at_spec.rb
sugarcube-2.11.0 spec/ios/image_color_at_spec.rb
sugarcube-2.10.0 spec/ios/image_color_at_spec.rb
sugarcube-2.9.1 spec/ios/image_color_at_spec.rb
sugarcube-2.8.2 spec/ios/image_color_at_spec.rb
sugarcube-2.8.1 spec/ios/image_color_at_spec.rb
sugarcube-2.8.0 spec/ios/image_color_at_spec.rb
sugarcube-2.7.1 spec/ios/image_color_at_spec.rb
sugarcube-2.7.0 spec/ios/image_color_at_spec.rb
sugarcube-2.6.0 spec/ios/image_color_at_spec.rb
sugarcube-2.5.0 spec/ios/image_color_at_spec.rb