Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9031c55
feat: create color indexer and color getter
brenocq Feb 13, 2026
abf076f
feat: add ImPlotProp_LineColors and ImPlotProp_FillColors properties
brenocq Feb 13, 2026
38aba54
feat: use GetterColor in RendererLineStrip
brenocq Feb 13, 2026
5f6f779
feat: per-index line colors demo
brenocq Feb 13, 2026
e9de1a6
feat: PlotShaded with per-index color
brenocq Feb 13, 2026
6e38fde
feat: PlotBubble with per-index color
brenocq Feb 13, 2026
0f48238
feat: GetterConstColor and GetterIdxColor
brenocq Feb 13, 2026
4d58001
feat: PlotStairs with per-index color
brenocq Feb 13, 2026
345dad1
feat: PlotBars with per-index color
brenocq Feb 13, 2026
1da69ac
feat: PlotInfLines and PlotStems with per-index color
brenocq Feb 13, 2026
56572e8
feat: add MarkerLineColors and MarkerFillColors properties
brenocq Feb 13, 2026
05c8809
fix: M_PI warnings
brenocq Feb 13, 2026
ede25b7
feat: improve colorful bubbles demo
brenocq Feb 13, 2026
55252b3
feat: improve colorful lines demo
brenocq Feb 13, 2026
4f4f456
feat: improve colorful shaded plots demo
brenocq Feb 13, 2026
93f7e82
feat: improve colorful stairstep plot demo
brenocq Feb 13, 2026
d1ca004
feat: improve colorful bar and stem demos
brenocq Feb 13, 2026
19d111a
Merge branch 'master' into feat/spec-colors
brenocq Feb 14, 2026
8d702bc
refactor: rename PlotBubble to PlotBubbles
brenocq Feb 14, 2026
5e27ca0
refactor: avoid duplicated code in marker rendering
brenocq Feb 14, 2026
f1c318b
feat: MarkerSizes property
brenocq Feb 14, 2026
ebcd473
merge: branch 'master' into feat/spec-colors
brenocq Apr 4, 2026
83438de
fix: missing FillAlpha in PlotBarsHEx
brenocq Apr 4, 2026
e31b6af
feat: add bounds checking to GetterIdxColor and GetterIdxSize
brenocq Apr 4, 2026
623e69c
fix: apply FillAlpha consistently in shaded const color paths
brenocq Apr 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions implot.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,18 @@ enum ImAxis_ {
// Plotting properties. These provide syntactic sugar for creating ImPlotSpecs from (ImPlotProp,value) pairs. See ImPlotSpec documentation.
enum ImPlotProp_ {
ImPlotProp_LineColor, // line color (applies to lines, bar edges); IMPLOT_AUTO_COL will use next Colormap color or current item color
ImPlotProp_LineColors, // array of colors for each line; if nullptr, use LineColor for all lines
ImPlotProp_LineWeight, // line weight in pixels (applies to lines, bar edges, marker edges)
ImPlotProp_FillColor, // fill color (applies to shaded regions, bar faces); IMPLOT_AUTO_COL will use next Colormap color or current item color
ImPlotProp_FillAlpha, // alpha multiplier (applies to FillColor and MarkerFillColor)
ImPlotProp_FillColors, // array of colors for each fill; if nullptr, use FillColor for all fills
ImPlotProp_FillAlpha, // alpha multiplier (applies to FillColor, FillColors, MarkerFillColor, and MarkerFillColors)
ImPlotProp_Marker, // marker type; specify ImPlotMarker_Auto to use the next unused marker
ImPlotProp_MarkerSize, // size of markers (radius) *in pixels*
ImPlotProp_MarkerSizes, // array of sizes for each marker; if nullptr, use MarkerSize for all markers
ImPlotProp_MarkerLineColor, // marker edge color; IMPLOT_AUTO_COL will use LineColor
ImPlotProp_MarkerLineColors, // array of colors for each marker edge; if nullptr, use MarkerLineColor for all markers
ImPlotProp_MarkerFillColor, // marker face color; IMPLOT_AUTO_COL will use LineColor
ImPlotProp_MarkerFillColors, // array of colors for each marker face; if nullptr, use MarkerFillColor for all markers
ImPlotProp_Size, // size of error bar whiskers (width or height), and digital bars (height) *in pixels*
ImPlotProp_Offset, // data index offset
ImPlotProp_Stride, // data stride in bytes; IMPLOT_AUTO will result in sizeof(T) where T is the type passed to PlotX
Expand Down Expand Up @@ -509,13 +514,18 @@ enum ImPlotBin_ {
// });
struct ImPlotSpec {
ImVec4 LineColor = IMPLOT_AUTO_COL; // line color (applies to lines, bar edges); IMPLOT_AUTO_COL will use next Colormap color or current item color
ImU32* LineColors = nullptr; // array of colors for each line; if nullptr, use LineColor for all lines
float LineWeight = 1.0f; // line weight in pixels (applies to lines, bar edges, marker edges)
ImVec4 FillColor = IMPLOT_AUTO_COL; // fill color (applies to shaded regions, bar faces); IMPLOT_AUTO_COL will use next Colormap color or current item color
float FillAlpha = 1.0f; // alpha multiplier (applies to FillColor and MarkerFillColor)
ImU32* FillColors = nullptr; // array of colors for each fill; if nullptr, use FillColor for all fills
float FillAlpha = 1.0f; // alpha multiplier (applies to FillColor, FillColors, MarkerFillColor, and MarkerFillColors)
ImPlotMarker Marker = ImPlotMarker_None; // marker type; specify ImPlotMarker_Auto to use the next unused marker
float MarkerSize = 4; // size of markers (radius) *in pixels*
float* MarkerSizes = nullptr; // array of sizes for each marker; if nullptr, use MarkerSize for all markers
ImVec4 MarkerLineColor = IMPLOT_AUTO_COL; // marker edge color; IMPLOT_AUTO_COL will use LineColor
ImU32* MarkerLineColors = nullptr; // array of colors for each marker edge; if nullptr, use MarkerLineColor for all markers
ImVec4 MarkerFillColor = IMPLOT_AUTO_COL; // marker face color; IMPLOT_AUTO_COL will use LineColor
ImU32* MarkerFillColors = nullptr; // array of colors for each marker face; if nullptr, use MarkerFillColor for all markers
float Size = 4; // size of error bar whiskers (width or height), and digital bars (height) *in pixels*
int Offset = 0; // data index offset
int Stride = IMPLOT_AUTO; // data stride in bytes; IMPLOT_AUTO will result in sizeof(T) where T is the type passed to PlotX
Expand Down Expand Up @@ -559,6 +569,27 @@ struct ImPlotSpec {
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from scalar value!");
}

// Set a property from a pointer value.
void SetProp(ImPlotProp prop, ImU32* v) {
switch (prop) {
case ImPlotProp_LineColors : LineColors = v; return;
case ImPlotProp_FillColors : FillColors = v; return;
case ImPlotProp_MarkerLineColors : MarkerLineColors = v; return;
case ImPlotProp_MarkerFillColors : MarkerFillColors = v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from pointer value!");
}

// Set a property from a float pointer value.
void SetProp(ImPlotProp prop, float* v) {
switch (prop) {
case ImPlotProp_MarkerSizes : MarkerSizes = v; return;
default: break;
}
IM_ASSERT(0 && "User provided an ImPlotProp which cannot be set from float pointer value!");
}

// Set a property from an ImVec4 value.
void SetProp(ImPlotProp prop, const ImVec4& v) {
switch (prop) {
Expand Down
Loading
Loading