You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.5 KiB
42 lines
1.5 KiB
using System; |
|
using System.Numerics; |
|
using System.Runtime.CompilerServices; |
|
using System.Text; |
|
|
|
namespace ImGuiNET |
|
{ |
|
public unsafe partial struct ImColor |
|
{ |
|
public Vector4 Value; |
|
} |
|
public unsafe partial struct ImColorPtr |
|
{ |
|
public ImColor* NativePtr { get; } |
|
public ImColorPtr(ImColor* nativePtr) => NativePtr = nativePtr; |
|
public ImColorPtr(IntPtr nativePtr) => NativePtr = (ImColor*)nativePtr; |
|
public static implicit operator ImColorPtr(ImColor* nativePtr) => new ImColorPtr(nativePtr); |
|
public static implicit operator ImColor* (ImColorPtr wrappedPtr) => wrappedPtr.NativePtr; |
|
public static implicit operator ImColorPtr(IntPtr nativePtr) => new ImColorPtr(nativePtr); |
|
public ref Vector4 Value => ref Unsafe.AsRef<Vector4>(&NativePtr->Value); |
|
public void SetHSV(float h, float s, float v) |
|
{ |
|
float a = 1.0f; |
|
ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); |
|
} |
|
public void SetHSV(float h, float s, float v, float a) |
|
{ |
|
ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); |
|
} |
|
public ImColor HSV(float h, float s, float v) |
|
{ |
|
float a = 1.0f; |
|
ImColor ret = ImGuiNative.ImColor_HSV(NativePtr, h, s, v, a); |
|
return ret; |
|
} |
|
public ImColor HSV(float h, float s, float v, float a) |
|
{ |
|
ImColor ret = ImGuiNative.ImColor_HSV(NativePtr, h, s, v, a); |
|
return ret; |
|
} |
|
} |
|
}
|
|
|