Create initial version of shard.
This commit is contained in:
27
spec/golden-color_spec.cr
Normal file
27
spec/golden-color_spec.cr
Normal file
@@ -0,0 +1,27 @@
|
||||
require "./spec_helper"
|
||||
|
||||
describe GoldenColor do
|
||||
describe ".from_rgb" do
|
||||
it "Correctly creates a color from red, green and blue" do
|
||||
c = GoldenColor::Color.from_rgb 0.0, 0.5, 1.0
|
||||
c.r.should eq 0.0
|
||||
c.g.should eq 0.5
|
||||
c.b.should eq 1.0
|
||||
end
|
||||
|
||||
it "Correctly creates a color from hue, saturation and value" do
|
||||
c = GoldenColor::Color.from_hsv 0.0, 0.5, 0.95
|
||||
c.r.should eq 0.95
|
||||
c.g.should eq 0.475
|
||||
c.b.should eq 0.475
|
||||
end
|
||||
|
||||
it "Correctly reports a tuple of red, green, and blue" do
|
||||
c = GoldenColor::Color.from_rgb 0.0, 0.5, 1.0
|
||||
r, g, b = c.rgb
|
||||
r.should eq c.r
|
||||
g.should eq c.g
|
||||
b.should eq c.b
|
||||
end
|
||||
end
|
||||
end
|
||||
2
spec/spec_helper.cr
Normal file
2
spec/spec_helper.cr
Normal file
@@ -0,0 +1,2 @@
|
||||
require "spec"
|
||||
require "../src/golden-color"
|
||||
Reference in New Issue
Block a user