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

Function plot_set_size

plot/plot.c:1040–1052  ·  view source on GitHub ↗

* @brief Stricter sibling of plot_set_window_size() that validates * inputs and reports success. * * Stores @p width and @p height verbatim on the plot. Unlike * plot_set_window_size(), which silently clamps small or zero sizes * to 100, this function rejects any non-positive dimension outright * by returning false without modifying the plot. Use this when you * want hard validation;

Source from the content-addressed store, hash-verified

1038 * - 0xRRGGBB form (top byte 0): treated as opaque.
1039 * - 0xAARRGGBB form (top byte != 0): used verbatim.
1040 *
1041 * @return The unpacked PlotColor. The function never fails.
1042 *
1043 * @note Because of the "top byte zero => opaque" rule, this function
1044 * cannot produce a fully transparent colour. If you genuinely
1045 * need alpha = 0 (e.g. for a transparent overlay), construct it
1046 * with plot_color() directly.
1047 *
1048 * @code
1049 * PlotColor blue = plot_color_hex(0x336699); // opaque
1050 * PlotColor shaded = plot_color_hex(0x80FF0000); // 50% red
1051 * @endcode
1052 */
1053PlotColor plot_color_hex(unsigned int rgb_or_rgba) {
1054 PLOT_LOG("[plot_color_hex]: enter (value=0x%08X)", rgb_or_rgba);
1055

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected