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



5977
5978
5979
# File 'lib/imgui.rb', line 5977

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



5967
5968
5969
5970
5971
5972
5973
5974
5975
# File 'lib/imgui.rb', line 5967

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



2906
2907
2908
# File 'lib/imgui.rb', line 2906

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

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



2902
2903
2904
# File 'lib/imgui.rb', line 2902

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