Class ImRaii.ColorDisposable
Assembly: Dalamud.dll
public sealed class ImRaii.ColorDisposable : IDisposable
Implements:
System.IDisposable
Properties
Count
Gets the number of colors currently pushed using this disposable.
public int Count { get; }
Methods
Push(ImGuiCol, uint, bool)
Push a color to the color stack.
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
| Type | Name | Description |
|---|---|---|
Dalamud.Bindings.ImGui.ImGuiCol | type | The type of color to change. |
System.UInt32 | color | The color to change it to. |
System.Boolean | condition | If 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.
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
| Type | Name | Description |
|---|---|---|
Dalamud.Bindings.ImGui.ImGuiCol | type | The type of color to change. |
System.Numerics.Vector4 | color | The color to change it to. |
System.Boolean | condition | If 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.
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
| Type | Name | Description |
|---|---|---|
Dalamud.Bindings.ImGui.ImGuiCol | type | The type of color to change. |
System.Nullable<System.Numerics.Vector4> | color | The color to change it to. If this is null, no color will be set. |
System.Boolean | condition | If 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.
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.
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
| Type | Name | Description |
|---|---|---|
Dalamud.Bindings.ImGui.ImGuiCol | type | The 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.
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
| Type | Name | Description |
|---|---|---|
System.Int32 | num | The number of colors to pop. This is clamped to the number of colors pushed by this object. |
Dispose()
Pop all pushed colors.
public void Dispose()
PopUnsafe(int)
Pop a number of colors.
public static void PopUnsafe(int num = 1)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | num | The 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