LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
ui_config.hpp File Reference

Central place to tweak the on-brain UI look. More...

#include "liblvgl/lvgl.h"

Go to the source code of this file.

Macros

Color palette

24-bit hex 0xRRGGBB.

lv_color_hex() wraps at use sites; not constexpr so these are #defines.

#define COL_BG   lv_color_hex(0x68468F)
 Screen background.
 
#define COL_PANEL   lv_color_hex(0x503570)
 Right info panel.
 
#define COL_ACCENT   lv_color_hex(0xFFDF61)
 Gold (headers, selected).
 
#define COL_ACCENT2   lv_color_hex(0xCCAA30)
 Gold gradient bottom.
 
#define COL_BTN_IDLE   lv_color_hex(0x553878)
 Unselected button background.
 
#define COL_BORDER   lv_color_hex(0xFFDF61)
 Border lines.
 
#define COL_TEXT   lv_color_hex(0xFFDF61)
 Primary text (gold).
 
#define COL_TEXT_DIM   lv_color_hex(0xCCAA30)
 Dim text.
 
#define COL_TEXT_SEL   lv_color_hex(0x3A2055)
 Dark text on gold background.
 
#define COL_YELLOW   lv_color_hex(0xFFDF61)
 Generic yellow.
 
#define COL_RED   lv_color_hex(0xFF4444)
 Warning / error red.
 
LVGL theme

Applied in lvgl_theme.cpp before PROS applies its default blue theme.

#define COL_THEME_PRIMARY   lv_color_hex(0x0D0D10)
 Primary theme background.
 
#define COL_THEME_SECONDARY   lv_color_hex(0x0D0D10)
 Secondary theme background.
 
#define UI_THEME_DARK   true
 Dark-mode flag for the theme.
 
#define UI_DEFAULT_FONT   (&lv_font_montserrat_20)
 Default UI font.
 

Variables

Animation timing (ms)

Bigger values = slower animations.

Change here to retune the feel of the selector / run screens.

constexpr int UI_ANIM_RUN_ZOOM_IN_MS = 550
 Zoom when opening run screen.
 
constexpr int UI_ANIM_RUN_ZOOM_OUT_MS = 450
 Zoom when pressing BACK.
 
constexpr int UI_ANIM_BANNER_PX_MS = 7
 Per-pixel scroll duration.
 
constexpr int UI_ANIM_BANNER_STAGGER_MS = 400
 Delay between buttons.
 
constexpr int UI_ANIM_BANNER_REPEAT_DELAY_MS = 800
 Delay before banner repeats.
 
constexpr int UI_ODOM_REFRESH_MS = 100
 Odom X/Y/Angle label refresh period.
 

Controller screen slots

One controller line, three text slots: LEFT | MID | RIGHT.

Pick one CtrlSlot per position. Line width ≈ 19 chars; slots fit 6 / 5 / 5.

#define UI_CTRL_LINE   1
 V5 controller line, 0..2.
 
#define UI_CTRL_REFRESH_MS   500
 Controller serial is slow; keep ≥ 500.
 
#define UI_CTRL_SLOT_LEFT   CtrlSlot::MaxMotorTempC
 Left slot content.
 
#define UI_CTRL_SLOT_MID   CtrlSlot::AutonTimer
 Middle slot content.
 
#define UI_CTRL_SLOT_RIGHT   CtrlSlot::None
 Right slot content.
 
enum class  CtrlSlot {
  None , MaxMotorTempC , AutonTimer , BatteryPct ,
  OdomX , OdomY , OdomTheta
}
 Per-slot content options for the controller status line. More...
 

Detailed Description

Central place to tweak the on-brain UI look.

Edit colors / font here and both the auton selector screen and the LVGL theme update together.

Covers:

  • Color palette used by the auton selector (purple/gold theme)
  • Default LVGL theme font
  • Theme primary / secondary background colors
Note
The live PID tuner (pid_tuner.cpp) has its own separate palette.

Definition in file ui_config.hpp.

Macro Definition Documentation

◆ COL_ACCENT

#define COL_ACCENT   lv_color_hex(0xFFDF61)

Gold (headers, selected).

Definition at line 27 of file ui_config.hpp.

◆ COL_ACCENT2

#define COL_ACCENT2   lv_color_hex(0xCCAA30)

Gold gradient bottom.

Definition at line 28 of file ui_config.hpp.

◆ COL_BG

#define COL_BG   lv_color_hex(0x68468F)

Screen background.

Definition at line 25 of file ui_config.hpp.

◆ COL_BORDER

#define COL_BORDER   lv_color_hex(0xFFDF61)

Border lines.

Definition at line 30 of file ui_config.hpp.

◆ COL_BTN_IDLE

#define COL_BTN_IDLE   lv_color_hex(0x553878)

Unselected button background.

Definition at line 29 of file ui_config.hpp.

◆ COL_PANEL

#define COL_PANEL   lv_color_hex(0x503570)

Right info panel.

Definition at line 26 of file ui_config.hpp.

◆ COL_RED

#define COL_RED   lv_color_hex(0xFF4444)

Warning / error red.

Definition at line 35 of file ui_config.hpp.

◆ COL_TEXT

#define COL_TEXT   lv_color_hex(0xFFDF61)

Primary text (gold).

Definition at line 31 of file ui_config.hpp.

◆ COL_TEXT_DIM

#define COL_TEXT_DIM   lv_color_hex(0xCCAA30)

Dim text.

Definition at line 32 of file ui_config.hpp.

◆ COL_TEXT_SEL

#define COL_TEXT_SEL   lv_color_hex(0x3A2055)

Dark text on gold background.

Definition at line 33 of file ui_config.hpp.

◆ COL_THEME_PRIMARY

#define COL_THEME_PRIMARY   lv_color_hex(0x0D0D10)

Primary theme background.

Definition at line 43 of file ui_config.hpp.

◆ COL_THEME_SECONDARY

#define COL_THEME_SECONDARY   lv_color_hex(0x0D0D10)

Secondary theme background.

Definition at line 44 of file ui_config.hpp.

◆ COL_YELLOW

#define COL_YELLOW   lv_color_hex(0xFFDF61)

Generic yellow.

Definition at line 34 of file ui_config.hpp.

◆ UI_CTRL_LINE

#define UI_CTRL_LINE   1

V5 controller line, 0..2.

Definition at line 85 of file ui_config.hpp.

◆ UI_CTRL_REFRESH_MS

#define UI_CTRL_REFRESH_MS   500

Controller serial is slow; keep ≥ 500.

Definition at line 86 of file ui_config.hpp.

◆ UI_CTRL_SLOT_LEFT

#define UI_CTRL_SLOT_LEFT   CtrlSlot::MaxMotorTempC

Left slot content.

Definition at line 87 of file ui_config.hpp.

◆ UI_CTRL_SLOT_MID

#define UI_CTRL_SLOT_MID   CtrlSlot::AutonTimer

Middle slot content.

Definition at line 88 of file ui_config.hpp.

◆ UI_CTRL_SLOT_RIGHT

#define UI_CTRL_SLOT_RIGHT   CtrlSlot::None

Right slot content.

Definition at line 89 of file ui_config.hpp.

◆ UI_DEFAULT_FONT

#define UI_DEFAULT_FONT   (&lv_font_montserrat_20)

Default UI font.

Must be one LVGL has compiled in (see lv_conf.h). Options: lv_font_montserrat_14, _16, _18, _20, _22, _24, …

Definition at line 51 of file ui_config.hpp.

◆ UI_THEME_DARK

#define UI_THEME_DARK   true

Dark-mode flag for the theme.

Definition at line 45 of file ui_config.hpp.

Enumeration Type Documentation

◆ CtrlSlot

enum class CtrlSlot
strong

Per-slot content options for the controller status line.

Enumerator
None 

Empty slot.

MaxMotorTempC 

"55C" — hottest drive/score motor.

AutonTimer 

"15.2s" — last auton elapsed time (set by autonomous()).

BatteryPct 

"87%" — main battery capacity.

OdomX 

"X24.5" — current odom X (inches).

OdomY 

"Y12.0" — current odom Y (inches).

OdomTheta 

"T90" — current odom heading (degrees).

Definition at line 75 of file ui_config.hpp.

Variable Documentation

◆ UI_ANIM_BANNER_PX_MS

constexpr int UI_ANIM_BANNER_PX_MS = 7
constexpr

Per-pixel scroll duration.

Definition at line 62 of file ui_config.hpp.

◆ UI_ANIM_BANNER_REPEAT_DELAY_MS

constexpr int UI_ANIM_BANNER_REPEAT_DELAY_MS = 800
constexpr

Delay before banner repeats.

Definition at line 64 of file ui_config.hpp.

◆ UI_ANIM_BANNER_STAGGER_MS

constexpr int UI_ANIM_BANNER_STAGGER_MS = 400
constexpr

Delay between buttons.

Definition at line 63 of file ui_config.hpp.

◆ UI_ANIM_RUN_ZOOM_IN_MS

constexpr int UI_ANIM_RUN_ZOOM_IN_MS = 550
constexpr

Zoom when opening run screen.

Definition at line 60 of file ui_config.hpp.

◆ UI_ANIM_RUN_ZOOM_OUT_MS

constexpr int UI_ANIM_RUN_ZOOM_OUT_MS = 450
constexpr

Zoom when pressing BACK.

Definition at line 61 of file ui_config.hpp.

◆ UI_ODOM_REFRESH_MS

constexpr int UI_ODOM_REFRESH_MS = 100
constexpr

Odom X/Y/Angle label refresh period.

Definition at line 65 of file ui_config.hpp.