Difference between revisions of "ImGui.Style:getColor"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' ImGui.Style<br/> === Description === Gets the color of an ImGui element. <source lang="lua"> (number), (...")
 
Line 10: Line 10:
  
 
=== Parameters ===
 
=== Parameters ===
'''imguielement''': (String) the ImGui element target '''([[ImGui|see ImGui Col constants]])'''<br/>
+
'''imguielement''': (String) the ImGui element target '''([[ImGui.CONST.Col|see ImGui.CONST.Col]])'''<br/>
  
 
=== Return values ===
 
=== Return values ===

Revision as of 06:07, 22 April 2021

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)