MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImAlphaBlendColors

Function ImAlphaBlendColors

KBotExt/imgui/imgui.cpp:2259–2273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2257 return bytes_count;
2258}
2259IM_MSVC_RUNTIME_CHECKS_RESTORE
2260
2261//-----------------------------------------------------------------------------
2262// [SECTION] MISC HELPERS/UTILITIES (Color functions)
2263// Note: The Convert functions are early design which are not consistent with other API.
2264//-----------------------------------------------------------------------------
2265
2266IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b)
2267{
2268 float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.f;
2269 int r = ImLerp((int)(col_a >> IM_COL32_R_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_R_SHIFT) & 0xFF, t);
2270 int g = ImLerp((int)(col_a >> IM_COL32_G_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_G_SHIFT) & 0xFF, t);
2271 int b = ImLerp((int)(col_a >> IM_COL32_B_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_B_SHIFT) & 0xFF, t);
2272 return IM_COL32(r, g, b, 0xFF);
2273}
2274
2275ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in)
2276{

Calls 1

ImLerpFunction · 0.85

Tested by

no test coverage detected