openpine_vm/visuals/
bgcolors.rs

1use openpine_compiler::instructions::Color;
2use serde::{Deserialize, Serialize};
3
4use crate::{series::Series, visuals::PlotDisplay};
5
6/// Background color series.
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct BackgroundColor {
9    /// Per-bar background color.
10    pub colors: Series<Option<Color>>,
11    /// Bar index offset.
12    pub offset: i32,
13    /// Whether the setting is user-editable.
14    pub editable: bool,
15    /// Optional limit for the number of visible bars.
16    pub show_last: Option<usize>,
17    /// Optional UI title.
18    pub title: Option<String>,
19    /// Display targets.
20    pub display: PlotDisplay,
21    /// Whether to force overlay rendering.
22    pub force_overlay: bool,
23}
24
25impl BackgroundColor {
26    pub(crate) fn append_new(&mut self) {
27        self.colors.append_new();
28    }
29}