1use gpui::{App, Global, Hsla};
4use theme::Theme;
5
6pub type FindPaint = fn(theme: &Theme) -> (Hsla, Hsla);
9
10struct Installed(FindPaint);
11
12impl Global for Installed {}
13
14pub(crate) fn set_find_paint(cx: &mut App, paint: FindPaint) {
17 cx.set_global(Installed(paint));
18}
19
20pub fn default_find(theme: &Theme) -> (Hsla, Hsla) {
22 (theme.accent.opacity(0.22), theme.accent.opacity(0.48))
23}
24
25pub(crate) fn find_paint_of(cx: &App) -> FindPaint {
26 cx.try_global::<Installed>()
27 .map_or(default_find, |installed| installed.0)
28}