Class: Abachrome::Gamut::SRGB
Instance Attribute Summary
Attributes inherited from Base
#name, #primaries, #white_point
Instance Method Summary collapse
- #contains?(coordinates) ⇒ Boolean
-
#initialize ⇒ SRGB
constructor
A new instance of SRGB.
Methods inherited from Base
Constructor Details
#initialize ⇒ SRGB
Returns a new instance of SRGB.
28 29 30 31 32 33 34 35 |
# File 'lib/abachrome/gamut/srgb.rb', line 28 def initialize primaries = { red: [0.6400, 0.3300], green: [0.3000, 0.6000], blue: [0.1500, 0.0600] } super(:srgb, primaries, :D65) end |
Instance Method Details
#contains?(coordinates) ⇒ Boolean
37 38 39 40 41 42 |
# File 'lib/abachrome/gamut/srgb.rb', line 37 def contains?(coordinates) r, g, b = coordinates r.between?(0, 1) && g >= 0 && g <= 1 && b >= 0 && b <= 1 end |