| 3152 | //------------------------------------------------------------------------------ |
| 3153 | |
| 3154 | ImPlot3DColormap AddColormap(const char* name, const ImVec4* colormap, int size, bool qual) { |
| 3155 | ImPlot3DContext& gp = *GImPlot3D; |
| 3156 | IM_ASSERT_USER_ERROR(size > 1, "The colormap size must be greater than 1!"); |
| 3157 | IM_ASSERT_USER_ERROR(gp.ColormapData.GetIndex(name) == -1, "The colormap name has already been used!"); |
| 3158 | ImVector<ImU32> buffer; |
| 3159 | buffer.resize(size); |
| 3160 | for (int i = 0; i < size; i++) |
| 3161 | buffer[i] = ImGui::ColorConvertFloat4ToU32(colormap[i]); |
| 3162 | return gp.ColormapData.Append(name, buffer.Data, size, qual); |
| 3163 | } |
| 3164 | |
| 3165 | ImPlot3DColormap AddColormap(const char* name, const ImU32* colormap, int size, bool qual) { |
| 3166 | ImPlot3DContext& gp = *GImPlot3D; |
no test coverage detected