Class: Colors::XYY
- Inherits:
-
AbstractColor
- Object
- AbstractColor
- Colors::XYY
- Includes:
- Helper
- Defined in:
- lib/colors/xyy.rb
Instance Attribute Summary collapse
-
#large_y ⇒ Object
readonly
Returns the value of attribute large_y.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #components ⇒ Object
-
#initialize(x, y, large_y) ⇒ XYY
constructor
A new instance of XYY.
- #luv_components(wp) ⇒ Object
- #rgb_components ⇒ Object
- #to_rgb ⇒ Object
- #to_xyz ⇒ Object
Methods inherited from AbstractColor
Constructor Details
#initialize(x, y, large_y) ⇒ XYY
Returns a new instance of XYY.
5 6 7 |
# File 'lib/colors/xyy.rb', line 5 def initialize(x, y, large_y) @x, @y, @large_y = canonicalize(x, y, large_y) end |
Instance Attribute Details
#large_y ⇒ Object (readonly)
Returns the value of attribute large_y.
9 10 11 |
# File 'lib/colors/xyy.rb', line 9 def large_y @large_y end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
9 10 11 |
# File 'lib/colors/xyy.rb', line 9 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
9 10 11 |
# File 'lib/colors/xyy.rb', line 9 def y @y end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/colors/xyy.rb', line 15 def ==(other) case other when XYY x == other.x && y == other.y && large_y == other.large_y else super end end |
#components ⇒ Object
11 12 13 |
# File 'lib/colors/xyy.rb', line 11 def components [x, y, large_y] end |
#luv_components(wp) ⇒ Object
32 33 34 |
# File 'lib/colors/xyy.rb', line 32 def luv_components(wp) to_xyz.luv_components(wp) end |
#rgb_components ⇒ Object
28 29 30 |
# File 'lib/colors/xyy.rb', line 28 def rgb_components to_xyz.rgb_components end |
#to_rgb ⇒ Object
24 25 26 |
# File 'lib/colors/xyy.rb', line 24 def to_rgb to_xyz.to_rgb end |
#to_xyz ⇒ Object
36 37 38 |
# File 'lib/colors/xyy.rb', line 36 def to_xyz XYZ.new(*Convert.xyy_to_xyz(*components)) end |