Difference between revisions of "ImGui.Style:getColor"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
(number), (number) = ImGui.Style:getColor(imguielement)
 
(number), (number) = ImGui.Style:getColor(imguielement)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 22: Line 22:
 
local color, a = style:getColor(ImGui.Col_TabHovered)
 
local color, a = style:getColor(ImGui.Col_TabHovered)
 
print(color, a)
 
print(color, a)
</source>
+
</syntaxhighlight>
  
 
{{ImGui.Style}}
 
{{ImGui.Style}}

Latest revision as of 15:29, 13 July 2023

Available since: Gideros 2020.9
Class: ImGui.Style

Description

Gets the color of an ImGui element.

(number), (number) = ImGui.Style:getColor(imguielement)

Parameters

imguielement: (String) the ImGui element target (see ImGui.CONST.Col)

Return values

Returns (number) color in hex format
Returns (number) alpha between 0 and 1

Example

local style = imgui:getStyle()
style:setColor(ImGui.Col_TabHovered, 0x54575b, 0.83)
local color, a = style:getColor(ImGui.Col_TabHovered)
print(color, a)