Class: Rszr::Color::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rszr/color/base.rb

Direct Known Subclasses

CMYA, RGBA

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alphaObject (readonly)

Returns the value of attribute alpha.



5
6
7
# File 'lib/rszr/color/base.rb', line 5

def alpha
  @alpha
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/rszr/color/base.rb', line 15

def ==(other)
  other.is_a?(Base) && rgba == other.rgba
end

#cmyaObject



11
12
13
# File 'lib/rszr/color/base.rb', line 11

def cmya
  [cyan, magenta, yellow, alpha]
end

#rgbaObject



7
8
9
# File 'lib/rszr/color/base.rb', line 7

def rgba
  [red, green, blue, alpha]
end

#to_fillObject



19
20
21
# File 'lib/rszr/color/base.rb', line 19

def to_fill(*)
  Fill.new(color: self)
end