MCPcopy Create free account
hub / github.com/clementgallet/libTAS / AddColormap

Function AddColormap

src/external/imgui/implot.cpp:4486–4495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4484//------------------------------------------------------------------------------
4485
4486ImPlotColormap AddColormap(const char* name, const ImVec4* colormap, int size, bool qual) {
4487 ImPlotContext& gp = *GImPlot;
4488 IM_ASSERT_USER_ERROR(size > 1, "The colormap size must be greater than 1!");
4489 IM_ASSERT_USER_ERROR(gp.ColormapData.GetIndex(name) == -1, "The colormap name has already been used!");
4490 ImVector<ImU32> buffer;
4491 buffer.resize(size);
4492 for (int i = 0; i < size; ++i)
4493 buffer[i] = ImGui::ColorConvertFloat4ToU32(colormap[i]);
4494 return gp.ColormapData.Append(name, buffer.Data, size, qual);
4495}
4496
4497ImPlotColormap AddColormap(const char* name, const ImU32* colormap, int size, bool qual) {
4498 ImPlotContext& gp = *GImPlot;

Callers 1

ShowStyleEditorFunction · 0.85

Calls 3

AppendMethod · 0.80
GetIndexMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected