use crate::*; impl Tek { pub(crate) fn colors ( theme: &ItemPalette, prev: Option, selected: bool, neighbor: bool, is_last: bool, ) -> [Color;4] { let fg = theme.lightest.rgb; let bg = if selected { theme.light } else { theme.base }.rgb; let hi = Self::color_hi(prev, neighbor); let lo = Self::color_lo(theme, is_last, selected); [fg, bg, hi, lo] } pub(crate) fn color_hi (prev: Option, neighbor: bool) -> Color { prev.map(|prev|if neighbor { prev.light.rgb } else { prev.base.rgb }).unwrap_or(Reset) } pub(crate) fn color_lo (theme: &ItemPalette, is_last: bool, selected: bool) -> Color { if is_last { Reset } else if selected { theme.light.rgb } else { theme.base.rgb } } }