Class: ImColor

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/imgui.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

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



5880
5881
5882
# File 'lib/imgui.rb', line 5880

def ImColor.col32(r = 0, g = 0, b = 0, a = 255)
  return ((a.to_i << 24) | (b.to_i << 0) | (g.to_i << 8) | (r.to_i << 16))
end

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



5870
5871
5872
5873
5874
5875
5876
5877
5878
# File 'lib/imgui.rb', line 5870

def ImColor.create(r = 0, g = 0, b = 0, a = 255)
  sc = 1.0 / 255.0
  instance = ImColor.new
  instance[:Value][:x] = r.to_f * sc
  instance[:Value][:y] = g.to_f * sc
  instance[:Value][:z] = b.to_f * sc
  instance[:Value][:w] = a.to_f * sc
  return instance
end

Instance Method Details

#HSV(h, s, v, a = 1.0) ⇒ Object



2890
2891
2892
# File 'lib/imgui.rb', line 2890

def HSV(h, s, v, a = 1.0)
  ImGui::ImColor_HSV(h, s, v, a)
end

#SetHSV(h, s, v, a = 1.0) ⇒ Object



2886
2887
2888
# File 'lib/imgui.rb', line 2886

def SetHSV(h, s, v, a = 1.0)
  ImGui::ImColor_SetHSV(self, h, s, v, a)
end