MCPcopy Create free account
hub / github.com/brenocq/implot3d / SampleColormapU32

Function SampleColormapU32

implot3d.cpp:3240–3245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3238ImVec4 GetColormapColor(int idx, ImPlot3DColormap cmap) { return ImGui::ColorConvertU32ToFloat4(GetColormapColorU32(idx, cmap)); }
3239
3240ImU32 SampleColormapU32(float t, ImPlot3DColormap cmap) {
3241 ImPlot3DContext& gp = *GImPlot3D;
3242 cmap = cmap == IMPLOT3D_AUTO ? gp.Style.Colormap : cmap;
3243 IM_ASSERT_USER_ERROR(cmap >= 0 && cmap < gp.ColormapData.Count, "Invalid colormap index!");
3244 return gp.ColormapData.LerpTable(cmap, t);
3245}
3246
3247ImVec4 SampleColormap(float t, ImPlot3DColormap cmap) { return ImGui::ColorConvertU32ToFloat4(SampleColormapU32(t, cmap)); }
3248

Callers 1

SampleColormapFunction · 0.85

Calls 1

LerpTableMethod · 0.80

Tested by

no test coverage detected