Class: Raylib::Color
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Color
- Defined in:
- lib/raylib/core/structs/color.rb
Overview
Color, 4 components, R8G8B8A8 (32bit)
Class Method Summary collapse
Instance Method Summary collapse
-
#a ⇒ unsigned char
Color alpha value.
-
#a=(new_a) ⇒ Object
Sets Color alpha value.
-
#b ⇒ unsigned char
Color blue value.
-
#b=(new_b) ⇒ Object
Sets Color blue value.
-
#g ⇒ unsigned char
Color green value.
-
#g=(new_g) ⇒ Object
Sets Color green value.
-
#r ⇒ unsigned char
Color red value.
-
#r=(new_r) ⇒ Object
Sets Color red value.
- #to_s ⇒ Object
Class Method Details
.create(r, g, b, a) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/raylib/core/structs/color.rb', line 11 def self.create(r, g, b, a) new.tap do |instance| instance[:r] = r instance[:g] = g instance[:b] = b instance[:a] = a end end |
Instance Method Details
#a ⇒ unsigned char
Color alpha value
53 |
# File 'lib/raylib/core/structs/color.rb', line 53 def a = self[:a] |
#a=(new_a) ⇒ Object
Sets Color alpha value
56 57 58 |
# File 'lib/raylib/core/structs/color.rb', line 56 def a=(new_a) self[:a] = new_a end |
#b ⇒ unsigned char
Color blue value
44 |
# File 'lib/raylib/core/structs/color.rb', line 44 def b = self[:b] |
#b=(new_b) ⇒ Object
Sets Color blue value
47 48 49 |
# File 'lib/raylib/core/structs/color.rb', line 47 def b=(new_b) self[:b] = new_b end |
#g ⇒ unsigned char
Color green value
35 |
# File 'lib/raylib/core/structs/color.rb', line 35 def g = self[:g] |
#g=(new_g) ⇒ Object
Sets Color green value
38 39 40 |
# File 'lib/raylib/core/structs/color.rb', line 38 def g=(new_g) self[:g] = new_g end |
#r ⇒ unsigned char
Color red value
26 |
# File 'lib/raylib/core/structs/color.rb', line 26 def r = self[:r] |
#r=(new_r) ⇒ Object
Sets Color red value
29 30 31 |
# File 'lib/raylib/core/structs/color.rb', line 29 def r=(new_r) self[:r] = new_r end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/raylib/core/structs/color.rb', line 20 def to_s "Raylib::Color##{object_id} r=#{r} g=#{g} b=#{b} a=#{a}" end |