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-4.0.0 spec/ios/image_color_at_spec.rb
sugarcube-3.5.0 spec/ios/image_color_at_spec.rb
sugarcube-3.4.2 spec/ios/image_color_at_spec.rb
sugarcube-3.4.1 spec/ios/image_color_at_spec.rb
sugarcube-3.4.0 spec/ios/image_color_at_spec.rb
sugarcube-3.3.7 spec/ios/image_color_at_spec.rb
sugarcube-3.3.6 spec/ios/image_color_at_spec.rb
sugarcube-3.3.5 spec/ios/image_color_at_spec.rb
sugarcube-3.3.4 spec/ios/image_color_at_spec.rb
sugarcube-3.3.3 spec/ios/image_color_at_spec.rb
sugarcube-3.3.2 spec/ios/image_color_at_spec.rb
sugarcube-3.3.1 spec/ios/image_color_at_spec.rb
sugarcube-3.3.0 spec/ios/image_color_at_spec.rb
sugarcube-3.2.0 spec/ios/image_color_at_spec.rb
sugarcube-3.1.1 spec/ios/image_color_at_spec.rb
sugarcube-3.1.0 spec/ios/image_color_at_spec.rb
sugarcube-3.0.8 spec/ios/image_color_at_spec.rb
sugarcube-3.0.7 spec/ios/image_color_at_spec.rb
sugarcube-3.0.6 spec/ios/image_color_at_spec.rb
sugarcube-3.0.5 spec/ios/image_color_at_spec.rb