- 
                Notifications
    You must be signed in to change notification settings 
- Fork 59
Description
Discussed in #141
Feature description
Allow users to specify a unique color for each individual data point within a plot item. This provides much greater flexibility for data visualization, enabling color to be used as a fourth dimension to represent properties like temperature, density, or category. This is a highly requested feature in the original ImPlot library, as seen in issues epezent/implot#608, epezent/implot#332, and epezent/implot#298.
This can be achieved by introducing new function overloads, such as PlotScatterC, PlotLineC, and PlotSurfaceC, which would accept an additional array of ImU32 colors corresponding to each data point.
A potential function signature would look like this:
IMPLOT3D_TMP void PlotScatterC(const char* label_id, const T* xs, const T* ys, const T* zs, const ImU32* colors, int count, ...);
Tasks
-  Define Public API: In implot3d.h, add newPlot*Cfunction overloads forPlotScatter,PlotLine,PlotTriangle,PlotQuad, andPlotSurface. These overloads will accept aconst ImU32* colorsparameter.
-  Extend Data Getters: In implot3d_items.cpp, create newGetterstructs (e.g.,GetterXYZC) that can retrieve per-point color in addition to coordinates. This will involve adding a colorIndexer(e.g.,IndexerIdx<ImU32>) to the getter.
-  Modify Renderers: Update the Rendererstructs inimplot3d_items.cppto handle per-vertex coloring.-  RendererMarkersFillandRendererMarkersLinemust be modified to fetch the color for each primitive from the newGetterinstead of using a single uniform color.
-  RendererLineStrip,RendererLineSegments, and other line-based renderers need to be updated to set the color for each vertex of the line segment's quad, allowing for color interpolation.
-  RendererSurfaceFillshould be adapted to use the provided color array instead of calculating colors from a colormap.
 
-  
-  Implement High-Level Plot Functions: In implot3d_items.cpp, implement the body of the newPlot*Cfunctions. These functions will instantiate the new color-awareGetterstructs and pass them to the appropriatePlot*Exfunctions and renderers.
-  Create Demo: Add a new section to implot3d_demo.cppto showcase the per-point coloring feature. This demo should:- Create a sample dataset.
-  Generate a corresponding array of ImU32colors (e.g., creating a gradient effect).
-  Call one or more of the new Plot*Cfunctions.
-  Be added to a tab in the ShowAllDemosfunction.