MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / plot_apply_theme_light

Function plot_apply_theme_light

plot/plot.c:1604–1617  ·  view source on GitHub ↗

* @brief Apply the built-in light theme. * * Sets the five chrome colours in one call: * - background: @c 0xFFFFFF (pure white), * - grid lines: @c 0xDCDCDC (very pale grey), * - axes & text: @c 0x000000 (black), * - legend background: @c 0xF5F5F5 (off-white), * - legend text: @c 0x000000. * * This is the same palette plot_create() installs by default,

Source from the content-addressed store, hash-verified

1602 * @endcode
1603 */
1604bool plot_set_series_label(Plot* plot, size_t index, const char* label) {
1605 PLOT_LOG("[plot_set_series_label]: enter (plot=%p, index=%zu, label=%s)", (void*)plot, index, label ? label : "(null)");
1606 if (!plot || index >= plot->seriesCount) {
1607 PLOT_LOG("[plot_set_series_label]: bad arg or OOR -> false");
1608 return false;
1609 }
1610 char* dup = NULL;
1611
1612 if (label) {
1613 size_t n = strlen(label) + 1;
1614 dup = (char*)malloc(n);
1615
1616 if (!dup) {
1617 PLOT_LOG("[plot_set_series_label]: OOM dup -> false");
1618 return false;
1619 }
1620 memcpy(dup, label, n);

Callers

nothing calls this directly

Calls 5

plot_color_hexFunction · 0.85
plot_set_grid_colorFunction · 0.85
plot_set_axis_colorFunction · 0.85
plot_set_legend_colorsFunction · 0.85

Tested by

no test coverage detected