MCPcopy Create free account
hub / github.com/RenderKit/embree / ImAlphaBlendColors

Function ImAlphaBlendColors

tutorials/common/imgui/imgui.cpp:2142–2149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2140//-----------------------------------------------------------------------------
2141
2142IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b)
2143{
2144 float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.f;
2145 int r = ImLerp((int)(col_a >> IM_COL32_R_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_R_SHIFT) & 0xFF, t);
2146 int g = ImLerp((int)(col_a >> IM_COL32_G_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_G_SHIFT) & 0xFF, t);
2147 int b = ImLerp((int)(col_a >> IM_COL32_B_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_B_SHIFT) & 0xFF, t);
2148 return IM_COL32(r, g, b, 0xFF);
2149}
2150
2151ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in)
2152{

Calls 1

ImLerpFunction · 0.85

Tested by

no test coverage detected