Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ImColor Struct Reference

#include <src/imgui/imgui.h>

+ Collaboration diagram for ImColor:

Public Member Functions

 ImColor ()
 
 ImColor (int r, int g, int b, int a=255)
 
 ImColor (ImU32 rgba)
 
 ImColor (float r, float g, float b, float a=1.0f)
 
 ImColor (const ImVec4 &col)
 
 operator ImU32 () const
 
 operator ImVec4 () const
 
void SetHSV (float h, float s, float v, float a=1.0f)
 

Static Public Member Functions

static ImColor HSV (float h, float s, float v, float a=1.0f)
 

Public Attributes

ImVec4 Value
 

Detailed Description

Constructor & Destructor Documentation

◆ ImColor() [1/5]

ImColor::ImColor ( )
inline
2190{ Value.x = Value.y = Value.z = Value.w = 0.0f; }
ImVec4 Value
Definition imgui.h:2188
float x
Definition imgui.h:259
float y
Definition imgui.h:259
float z
Definition imgui.h:259
float w
Definition imgui.h:259

◆ ImColor() [2/5]

ImColor::ImColor ( int  r,
int  g,
int  b,
int  a = 255 
)
inline
2191{ float sc = 1.0f / 255.0f; Value.x = (float)r * sc; Value.y = (float)g * sc; Value.z = (float)b * sc; Value.w = (float)a * sc; }

◆ ImColor() [3/5]

ImColor::ImColor ( ImU32  rgba)
inline
2192{ float sc = 1.0f / 255.0f; Value.x = (float)((rgba >> IM_COL32_R_SHIFT) & 0xFF) * sc; Value.y = (float)((rgba >> IM_COL32_G_SHIFT) & 0xFF) * sc; Value.z = (float)((rgba >> IM_COL32_B_SHIFT) & 0xFF) * sc; Value.w = (float)((rgba >> IM_COL32_A_SHIFT) & 0xFF) * sc; }
#define IM_COL32_G_SHIFT
Definition imgui.h:2172
#define IM_COL32_R_SHIFT
Definition imgui.h:2171
#define IM_COL32_B_SHIFT
Definition imgui.h:2173
#define IM_COL32_A_SHIFT
Definition imgui.h:2174

References IM_COL32_A_SHIFT, IM_COL32_B_SHIFT, IM_COL32_G_SHIFT, and IM_COL32_R_SHIFT.

◆ ImColor() [4/5]

ImColor::ImColor ( float  r,
float  g,
float  b,
float  a = 1.0f 
)
inline

◆ ImColor() [5/5]

ImColor::ImColor ( const ImVec4 col)
inline
2194{ Value = col; }
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
Definition BlockMethods.h:838

References col().

+ Here is the call graph for this function:

Member Function Documentation

◆ HSV()

static ImColor ImColor::HSV ( float  h,
float  s,
float  v,
float  a = 1.0f 
)
inlinestatic
2200{ float r, g, b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r, g, b, a); }
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
Definition imgui.cpp:1843
ImColor()
Definition imgui.h:2190

References ImGui::ColorConvertHSVtoRGB().

Referenced by ShowDemoWindowLayout(), and ShowDemoWindowWidgets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator ImU32()

ImColor::operator ImU32 ( ) const
inline
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4 &in)
Definition imgui.cpp:1809

References ImGui::ColorConvertFloat4ToU32().

+ Here is the call graph for this function:

◆ operator ImVec4()

ImColor::operator ImVec4 ( ) const
inline
2196{ return Value; }

◆ SetHSV()

void ImColor::SetHSV ( float  h,
float  s,
float  v,
float  a = 1.0f 
)
inline

References ImGui::ColorConvertHSVtoRGB().

+ Here is the call graph for this function:

Member Data Documentation

◆ Value

ImVec4 ImColor::Value

The documentation for this struct was generated from the following file: