mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-26 14:51:46 +01:00
Merge pull request #1068 from codecat/fix-colorbutton
ColorButton: fix showing wrong hex value for alpha in tooltip.
This commit is contained in:
commit
9a068ce005
@ -8973,7 +8973,7 @@ bool ImGui::ColorButton(const ImVec4& col, bool small_height, bool outline_borde
|
|||||||
RenderFrame(bb.Min, bb.Max, GetColorU32(col), outline_border, style.FrameRounding);
|
RenderFrame(bb.Min, bb.Max, GetColorU32(col), outline_border, style.FrameRounding);
|
||||||
|
|
||||||
if (hovered)
|
if (hovered)
|
||||||
SetTooltip("Color:\n(%.2f,%.2f,%.2f,%.2f)\n#%02X%02X%02X%02X", col.x, col.y, col.z, col.w, IM_F32_TO_INT8_SAT(col.x), IM_F32_TO_INT8_SAT(col.y), IM_F32_TO_INT8_SAT(col.z), IM_F32_TO_INT8_SAT(col.z));
|
SetTooltip("Color:\n(%.2f,%.2f,%.2f,%.2f)\n#%02X%02X%02X%02X", col.x, col.y, col.z, col.w, IM_F32_TO_INT8_SAT(col.x), IM_F32_TO_INT8_SAT(col.y), IM_F32_TO_INT8_SAT(col.z), IM_F32_TO_INT8_SAT(col.w));
|
||||||
|
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user