dymokomi/luced-message
Source of release 0.5.0
## luced-message's palette: luced-2d's greys and #E7A03F orange in the same linear-light
## color space, kept local so the shared UI package stays neutral.
from luce_ui.ui import Theme
from luce_gpu.gpu import Color
from luce_color import transfer
## A grey from an sRGB byte value.
pub func grey(byte: float) -> Color:
let value = transfer.srgb_decode(byte / 255.0)
return Color(value, value, value)
## A color from sRGB byte values.
pub func srgb(red: float, green: float, blue: float) -> Color:
return Color(transfer.srgb_decode(red / 255.0), transfer.srgb_decode(green / 255.0), transfer.srgb_decode(blue / 255.0))
pub func accent() -> Color:
return srgb(231.0, 160.0, 63.0)
## Flagged messages: luced's warning yellow.
pub func flag() -> Color:
return srgb(226.0, 198.0, 70.0)
## Unread markers.
pub func unread() -> Color:
return srgb(101.0, 151.0, 194.0)
pub func backdrop() -> Color:
return grey(26.0)
pub func tab_strip() -> Color:
return grey(38.0)
pub func surface() -> Color:
return grey(50.0)
pub func surface_raised() -> Color:
return grey(46.0)
pub func border() -> Color:
return grey(58.0)
pub func text() -> Color:
return grey(217.0)
pub func text_muted() -> Color:
return grey(140.0)
pub func editor_theme() -> Theme!:
var theme = Theme()
theme.background = backdrop()
theme.panel = surface()
theme.gutter = tab_strip()
theme.foreground = text()
theme.muted = text_muted()
theme.selection = accent()
theme.accent = accent()
theme.button = grey(41.0)
theme.button_hover = grey(58.0)
theme.pressed = grey(72.0)
theme.menu = surface_raised()
theme.menu_hover = grey(64.0)
theme.strip = tab_strip()
theme.sunken = grey(41.0)
theme.raised = surface_raised()
theme.accent_text = grey(0.0)
theme.menu_selection = accent()
theme.border = border()
theme.active_border = grey(150.0)
theme.shadow_offset = 0.0
theme.shadow_opacity = 0.0
theme.control_radius = 5.0
return theme