Create initial version of shard.

This commit is contained in:
2018-09-18 23:06:12 -07:00
commit 3d9cf7858b
9 changed files with 176 additions and 0 deletions

27
spec/golden-color_spec.cr Normal file
View 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
View File

@@ -0,0 +1,2 @@
require "spec"
require "../src/golden-color"