Class: Raylib::Color

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib_main.rb,
lib/raylib_helper.rb

Overview

Color helper

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_u8(r = 0, g = 0, b = 0, a = 255) ⇒ Object



11
12
13
# File 'lib/raylib_helper.rb', line 11

def self.from_u8(r = 0, g = 0, b = 0, a = 255)
  Color.new.set(r, g, b, a)
end

Instance Method Details

#aObject



530
# File 'lib/raylib_main.rb', line 530

def a = self[:a]

#a=(v) ⇒ Object



531
# File 'lib/raylib_main.rb', line 531

def a=(v) self[:a] = v end

#bObject



528
# File 'lib/raylib_main.rb', line 528

def b = self[:b]

#b=(v) ⇒ Object



529
# File 'lib/raylib_main.rb', line 529

def b=(v) self[:b] = v end

#copy(other) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/raylib_helper.rb', line 23

def copy(other)
  self[:r] = other.r
  self[:g] = other.g
  self[:b] = other.b
  self[:a] = other.a
  self
end

#gObject



526
# File 'lib/raylib_main.rb', line 526

def g = self[:g]

#g=(v) ⇒ Object



527
# File 'lib/raylib_main.rb', line 527

def g=(v) self[:g] = v end

#rObject



524
# File 'lib/raylib_main.rb', line 524

def r = self[:r]

#r=(v) ⇒ Object



525
# File 'lib/raylib_main.rb', line 525

def r=(v) self[:r] = v end

#set(r, g, b, a) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/raylib_helper.rb', line 15

def set(r, g, b, a)
  self[:r] = r
  self[:g] = g
  self[:b] = b
  self[:a] = a
  self
end