Skip to main content
Version: 15.x (API 15) [Current]

Class ImRaii.ColorDisposable

Assembly: Dalamud.dll​
Declaration
public sealed class ImRaii.ColorDisposable : IDisposable

Implements:
System.IDisposable

Properties​

Count​

Gets the number of colors currently pushed using this disposable.

Declaration
public int Count { get; }

Methods​

Push(ImGuiCol, uint, bool)​

Push a color to the color stack.

Declaration
public ImRaii.ColorDisposable Push(ImGuiCol type, uint color, bool condition = true)
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Parameters​
TypeNameDescription
Dalamud.Bindings.ImGui.ImGuiColtypeThe type of color to change.
System.UInt32colorThe color to change it to.
System.BooleanconditionIf this is false, the color is not pushed.
Remarks​

If you need to keep colors pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable.PopUnsafe(int).

Push(ImGuiCol, Vector4, bool)​

Push a color to the color stack.

Declaration
public ImRaii.ColorDisposable Push(ImGuiCol type, Vector4 color, bool condition = true)
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Parameters​
TypeNameDescription
Dalamud.Bindings.ImGui.ImGuiColtypeThe type of color to change.
System.Numerics.Vector4colorThe color to change it to.
System.BooleanconditionIf this is false, the color is not pushed.
Remarks​

If you need to keep colors pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable.PopUnsafe(int).

Push(ImGuiCol, Vector4?, bool)​

Push a color to the color stack.

Declaration
public ImRaii.ColorDisposable Push(ImGuiCol type, Vector4? color, bool condition = true)
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Parameters​
TypeNameDescription
Dalamud.Bindings.ImGui.ImGuiColtypeThe type of color to change.
System.Nullable<System.Numerics.Vector4>colorThe color to change it to. If this is null, no color will be set.
System.BooleanconditionIf this is false, the color is not pushed.
Remarks​

If you need to keep colors pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable.PopUnsafe(int).

PushDefaultColors()​

Reverts all pushed colors to their previous values temporarily.

Declaration
public static ImRaii.ColorDisposable PushDefaultColors()
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Remarks​

If you need to keep colors pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable.PopUnsafe(int).

PushDefault(ImGuiCol)​

Push the default value, i.e. the value as if nothing was ever pushed to this, of a color to the color stack.

Declaration
public ImRaii.ColorDisposable PushDefault(ImGuiCol type)
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Parameters​
TypeNameDescription
Dalamud.Bindings.ImGui.ImGuiColtypeThe type of color to return to its default value.
Remarks​

If you need to keep colors pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable.PopUnsafe(int).

Pop(int)​

Pop a number of colors.

Declaration
public ImRaii.ColorDisposable Pop(int num = 1)
Returns​

Dalamud.Interface.Utility.Raii.ImRaii.ColorDisposable: A disposable object that can be used to push further colors and pops those colors after leaving scope. Use with using.

Parameters​
TypeNameDescription
System.Int32numThe number of colors to pop. This is clamped to the number of colors pushed by this object.

Dispose()​

Pop all pushed colors.

Declaration
public void Dispose()

PopUnsafe(int)​

Pop a number of colors.

Declaration
public static void PopUnsafe(int num = 1)
Parameters​
TypeNameDescription
System.Int32numThe number of colors to pop. The number is not checked against the color stack.
Remarks​

Avoid using this function, and colors across scopes, as much as possible.

Implements​

  • System.IDisposable