Add debugging colors to styled_ext
This commit is contained in:
parent
c9dd6b879c
commit
cb0880cf3c
1 changed files with 25 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
use gpui::{px, Styled, WindowContext};
|
||||
use gpui::{hsla, px, Styled, WindowContext};
|
||||
use settings::Settings;
|
||||
use theme::ThemeSettings;
|
||||
|
||||
|
@ -104,6 +104,30 @@ pub trait StyledExt: Styled + Sized {
|
|||
fn elevation_3(self, cx: &mut WindowContext) -> Self {
|
||||
elevated(self, cx, ElevationIndex::ModalSurface)
|
||||
}
|
||||
|
||||
fn debug_bg_red(self) -> Self {
|
||||
self.bg(gpui::red())
|
||||
}
|
||||
|
||||
fn debug_bg_green(self) -> Self {
|
||||
self.bg(gpui::green())
|
||||
}
|
||||
|
||||
fn debug_bg_blue(self) -> Self {
|
||||
self.bg(gpui::blue())
|
||||
}
|
||||
|
||||
fn debug_bg_yellow(self) -> Self {
|
||||
self.bg(hsla(60. / 360., 1., 0.5, 1.))
|
||||
}
|
||||
|
||||
fn debug_bg_cyan(self) -> Self {
|
||||
self.bg(hsla(160. / 360., 1., 0.5, 1.))
|
||||
}
|
||||
|
||||
fn debug_bg_magenta(self) -> Self {
|
||||
self.bg(hsla(300. / 360., 1., 0.5, 1.))
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Styled> StyledExt for E {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue