mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Added ColorConvertU32ToFloat4() helper and ImColor(ImU32) constructor.
This commit is contained in:
		@@ -1039,6 +1039,12 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e
 | 
			
		||||
    return bytes_count;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in)
 | 
			
		||||
{
 | 
			
		||||
    float s = 1.0f/255.0f;
 | 
			
		||||
    return ImVec4((in & 0xFF) * s, ((in >> 8) & 0xFF) * s, ((in >> 16) & 0xFF) * s, (in >> 24) * s);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
 | 
			
		||||
{
 | 
			
		||||
    ImU32 out  = ((ImU32)(ImSaturate(in.x)*255.f));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user