MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ColorConvertFloat4ToU32

Method ColorConvertFloat4ToU32

imgui_tiny_app/imgui/imgui.cpp:2881–2889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2879}
2880
2881ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
2882{
2883 ImU32 out;
2884 out = ((ImU32)IM_F32_TO_INT8_SAT(in.x)) << IM_COL32_R_SHIFT;
2885 out |= ((ImU32)IM_F32_TO_INT8_SAT(in.y)) << IM_COL32_G_SHIFT;
2886 out |= ((ImU32)IM_F32_TO_INT8_SAT(in.z)) << IM_COL32_B_SHIFT;
2887 out |= ((ImU32)IM_F32_TO_INT8_SAT(in.w)) << IM_COL32_A_SHIFT;
2888 return out;
2889}
2890
2891// Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p592
2892// Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected