| 4484 | //------------------------------------------------------------------------------ |
| 4485 | |
| 4486 | ImPlotColormap 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 | |
| 4497 | ImPlotColormap AddColormap(const char* name, const ImU32* colormap, int size, bool qual) { |
| 4498 | ImPlotContext& gp = *GImPlot; |
no test coverage detected