pub struct Artwork {
pub width: u32,
pub height: u32,
pub url: String,
pub text_color1: Option<String>,
pub text_color2: Option<String>,
pub text_color3: Option<String>,
pub text_color4: Option<String>,
pub bg_color: Option<String>,
pub has_p3: Option<bool>,
}Expand description
Artwork metadata for a track, album, or station.
The url field may contain {w} and {h} placeholders for the desired
image dimensions. Use Artwork::url_for_size to get a ready-to-use URL.
Color fields (text_color1–text_color4, bg_color) are hex color strings
present on certain container artwork (e.g. radio stations).
§Examples
let art = Artwork {
width: 600,
height: 600,
url: "https://example.com/img/{w}x{h}bb.jpg".into(),
..Default::default()
};
assert_eq!(
art.url_for_size(300),
"https://example.com/img/300x300bb.jpg"
);Fields§
§width: u32Image width in pixels.
height: u32Image height in pixels.
url: StringURL template — may contain {w} and {h} size placeholders.
text_color1: Option<String>Primary text color (hex, e.g. "eaccc1"). Present on station artwork.
text_color2: Option<String>Secondary text color (hex). Present on station artwork.
text_color3: Option<String>Tertiary text color (hex). Present on station artwork.
text_color4: Option<String>Quaternary text color (hex). Present on station artwork.
bg_color: Option<String>Background color (hex, e.g. "0c0e0d"). Present on station artwork.
has_p3: Option<bool>Whether the artwork uses the Display P3 color space.