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), (...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Gets the color of an ImGui element. | Gets the color of an ImGui element. | ||
− | < | + | <syntaxhighlight lang="lua"> |
(number), (number) = ImGui.Style:getColor(imguielement) | (number), (number) = ImGui.Style:getColor(imguielement) | ||
− | </ | + | </syntaxhighlight> |
=== Parameters === | === Parameters === | ||
− | '''imguielement''': (String) the ImGui element target '''([[ImGui|see ImGui Col | + | '''imguielement''': (String) the ImGui element target '''([[ImGui.CONST.Col|see ImGui.CONST.Col]])'''<br/> |
=== Return values === | === Return values === | ||
Line 17: | Line 17: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
local style = imgui:getStyle() | local style = imgui:getStyle() | ||
style:setColor(ImGui.Col_TabHovered, 0x54575b, 0.83) | style:setColor(ImGui.Col_TabHovered, 0x54575b, 0.83) | ||
local color, a = style:getColor(ImGui.Col_TabHovered) | local color, a = style:getColor(ImGui.Col_TabHovered) | ||
print(color, a) | print(color, a) | ||
− | </ | + | </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)
- ImGui.Style
- ImGui.Style:getAlpha
- ImGui.Style:getColor
- ImGui.Style:getDisplaySafeAreaPadding
- ImGui.Style:getItemSpacing
- ImGui.Style:getScrollbarRounding
- ImGui.Style:getScrollbarSize
- ImGui.Style:getTouchExtraPadding
- ImGui.Style:getWindowBorderSize
- ImGui.Style:getWindowMinSize
- ImGui.Style:getWindowRounding
- ImGui.Style:getWindowTitleAlign
- ImGui.Style:setAlpha
- ImGui.Style:setColor
- ImGui.Style:setDisplaySafeAreaPadding
- ImGui.Style:setItemSpacing
- ImGui.Style:setScrollbarRounding
- ImGui.Style:setScrollbarSize
- ImGui.Style:setTouchExtraPadding
- ImGui.Style:setWindowBorderSize
- ImGui.Style:setWindowMinSize
- ImGui.Style:setWindowRounding
- ImGui.Style:setWindowTitleAlign