Sha256: a0f89940d6b7913da75b40d2f226da2df2038842f33406775d08ea3983866282

Contents?: true

Size: 799 Bytes

Versions: 54

Compression:

Stored size: 799 Bytes

Contents

describe "NSColor component methods" do
  before do
    @black = NSColor.blackColor
    @gray = NSColor.grayColor
    @white = NSColor.whiteColor
    @some_color = NSColor.colorWithRed(0.6, green: 0.4, blue: 0.5, alpha:1.0)
  end

  it "should return 1,1,1 for white" do
    @white.red.should == 1
    @white.green.should == 1
    @white.blue.should == 1
  end

  it "should return 0,0,0 for black" do
    @black.red.should == 0
    @black.green.should == 0
    @black.blue.should == 0
  end

  it "should return 0.5,0.5,0.5 for gray" do
    @gray.red.should == 0.5
    @gray.green.should == 0.5
    @gray.blue.should == 0.5
  end

  it "should return correct rgb for some_color" do
    @some_color.red.should == 0.6
    @some_color.green.should == 0.4
    @some_color.blue.should == 0.5
  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
sugarcube-3.0.4 spec/osx/color_components_spec.rb
sugarcube-3.0.3 spec/osx/color_components_spec.rb
sugarcube-3.0.2 spec/osx/color_components_spec.rb
sugarcube-3.0.1 spec/osx/color_components_spec.rb
sugarcube-3.0.0 spec/osx/color_components_spec.rb
sugarcube-2.12.3 spec/osx/color_components_spec.rb
sugarcube-2.12.2 spec/osx/color_components_spec.rb
sugarcube-2.12.1 spec/osx/color_components_spec.rb
sugarcube-2.12.0 spec/osx/color_components_spec.rb
sugarcube-2.11.1 spec/osx/color_components_spec.rb
sugarcube-2.11.0 spec/osx/color_components_spec.rb
sugarcube-2.10.0 spec/osx/color_components_spec.rb
sugarcube-2.9.1 spec/osx/color_components_spec.rb
sugarcube-2.8.2 spec/osx/color_components_spec.rb
sugarcube-2.8.1 spec/osx/color_components_spec.rb
sugarcube-2.8.0 spec/osx/color_components_spec.rb
sugarcube-2.7.1 spec/osx/color_components_spec.rb
sugarcube-2.7.0 spec/osx/color_components_spec.rb
sugarcube-2.6.0 spec/osx/color_components_spec.rb
sugarcube-2.5.0 spec/osx/color_components_spec.rb