feat(color): add lv_color_get_palette_... functions and update the default theme accordingly

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-26 13:02:06 +01:00
parent 17a619bd95
commit c9abb38e67
9 changed files with 560 additions and 152 deletions

View File

@@ -21,56 +21,24 @@
* DEFINES
*********************/
#define RADIUS_DEFAULT LV_DPX(10)
static lv_color_t color_primary_accent;// lv_color_indigo_accent_3()
static lv_color_t color_secondary_accent;// lv_color_red_accent_3()
static lv_color_t color_primary_muted;// lv_color_indigo_lighten_5()
static lv_color_t color_secondary_muted;// lv_color_indigo_lighten_5()
#define COLOR_GREY lv_color_grey_lighten_2()
#define RADIUS_DEFAULT LV_DPX(12)
/*SCREEN*/
#define COLOR_SCR (IS_LIGHT ? lv_color_grey_lighten_5() : lv_color_hex(0x444b5a))
#define COLOR_SCR_TEXT (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0xe7e9ec))
/*BUTTON*/
#define BTN_COLOR (theme.color_primary)
#define BTN_PR_COLOR (lv_color_darken(theme.color_primary, LV_OPA_20))
#define BTN_CHK_DIS_COLOR (lv_color_lighten(theme.color_primary, LV_OPA_40))
#define BTN_CHK_COLOR (theme.color_secondary)
#define BTN_CHK_PR_COLOR (lv_color_darken(theme.color_secondary, LV_OPA_20))
#define BTN_DIS_COLOR (lv_color_lighten(theme.color_secondary, LV_OPA_40))
#define BTN_BORDER_COLOR theme.color_primary
#define COLOR_BTN_BORDER_INA (IS_LIGHT ? lv_color_hex3(0x888) : lv_color_hex(0x404040))
/*BACKGROUND*/
#define CARD_COLOR (IS_LIGHT ? lv_color_hex(0xffffff) : lv_color_hex(0x586273))
#define CARD_PR_COLOR (IS_LIGHT ? lv_color_hex(0xeeeeee) : lv_color_hex(0x494f57))
#define COLOR_BG_CHK theme.color_primary
#define COLOR_BG_PR_CHK lv_color_darken(theme.color_primary, LV_OPA_20)
#define COLOR_BG_DIS CARD_COLOR
#define CARD_BORDER_COLOR (IS_LIGHT ? lv_color_hex(0xd6dde3) : lv_color_hex(0x808a97)) /*dfe7ed*/
#define COLOR_BG_BORDER_PR (IS_LIGHT ? lv_color_hex3(0xccc) : lv_color_hex(0x5f656e))
#define COLOR_BG_BORDER_CHK (IS_LIGHT ? lv_color_hex(0xd6dde3) : lv_color_hex(0x5f656e))
#define COLOR_BG_BORDER_CHK_PR (IS_LIGHT ? lv_color_hex3(0xccc) : lv_color_hex(0x5f656e))
#define COLOR_BG_BORDER_DIS (IS_LIGHT ? lv_color_hex(0xd6dde3) : lv_color_hex(0x5f656e))
#define CARD_TEXT_COLOR (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0xffffff))
#define CARD_TEXT_PR_COLOR (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0xffffff))
#define COLOR_BG_TEXT_CHK (IS_LIGHT ? lv_color_hex(0xffffff) : lv_color_hex(0xffffff))
#define COLOR_BG_TEXT_CHK_PR (IS_LIGHT ? lv_color_hex(0xffffff) : lv_color_hex(0xffffff))
#define COLOR_BG_TEXT_DIS (IS_LIGHT ? lv_color_hex3(0xaaa) : lv_color_hex3(0x999))
/*SECONDARY BACKGROUND*/
#define COLOR_GRAY (IS_LIGHT ? lv_color_hex(0xcccfd1) : lv_color_hex(0x45494d))
#define COLOR_BG_SEC_BORDER (IS_LIGHT ? lv_color_hex(0xdfe7ed) : lv_color_hex(0x404040))
#define COLOR_BG_SEC_TEXT (IS_LIGHT ? lv_color_hex(0x31404f) : lv_color_hex(0xa5a8ad))
#define COLOR_BG_SEC_TEXT_DIS (IS_LIGHT ? lv_color_hex(0xaaaaaa) : lv_color_hex(0xa5a8ad))
#define COLOR_SCR lv_color_grey_lighten_4()
#define COLOR_SCR_TEXT lv_color_grey_darken_4()
#define TRANSITION_TIME LV_THEME_DEFAULT_TRANSITON_TIME
#define BORDER_WIDTH LV_DPX(2)
#define OUTLINE_WIDTH LV_DPX(2)
#define IS_LIGHT (LV_THEME_DEFAULT_PALETTE_LIGHT)
#define PAD_DEF LV_DPX(15)
//(lv_disp_get_size_category(NULL) <= LV_DISP_SIZE_MEDIUM ? LV_DPX(15) : (LV_DPX(30)))
#define PAD_DEF LV_DPX(24)
/**********************
* TYPEDEFS
@@ -84,9 +52,9 @@ typedef struct {
/*Utility*/
lv_style_t bg_color_primary;
lv_style_t bg_color_primary_light;
lv_style_t bg_color_primary_muted;
lv_style_t bg_color_secondary;
lv_style_t bg_color_gray;
lv_style_t bg_color_grey;
lv_style_t bg_color_white;
lv_style_t pressed;
lv_style_t disabled;
@@ -97,8 +65,8 @@ typedef struct {
lv_style_t pad_small_negative;
lv_style_t line_space_large;
lv_style_t text_align_center;
lv_style_t focus_outline;
lv_style_t edit_outline;
lv_style_t outline_primary;
lv_style_t outline_secondary;
lv_style_t circle;
lv_style_t no_radius;
lv_style_t clip_corner;
@@ -171,7 +139,6 @@ typedef struct {
* STATIC PROTOTYPES
**********************/
static void theme_apply(lv_theme_t * th, lv_obj_t * obj);
static lv_color_t gray_filter(lv_color_t color, lv_opa_t opa);
static void style_init_reset(lv_style_t * style);
/**********************
@@ -190,12 +157,19 @@ static bool inited;
* STATIC FUNCTIONS
**********************/
static lv_color_t dark_color_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t c, lv_opa_t opa)
{
LV_UNUSED(f);
return lv_color_darken(c, opa);
}
static lv_color_t grey_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t color, lv_opa_t opa)
{
LV_UNUSED(f);
return lv_color_mix(lv_color_white(), color, opa);
}
static void style_init(void)
{
static const lv_style_prop_t trans_props[] = {
@@ -207,6 +181,14 @@ static void style_init(void)
0
};
color_primary_accent = lv_color_get_palette_accent_4(theme.palette_primary);
color_secondary_accent = lv_color_get_palette_accent_4(theme.palette_secondary);
color_primary_muted = lv_color_get_palette_lighten_5(theme.palette_primary);
color_secondary_muted = lv_color_get_palette_lighten_5(theme.palette_secondary);
theme.color_primary = color_primary_accent;
theme.color_secondary = color_secondary_accent;
static lv_style_transition_dsc_t trans_delayed;
lv_style_transition_dsc_init(&trans_delayed, trans_props, &lv_anim_path_def, TRANSITION_TIME, 70);
@@ -221,7 +203,7 @@ static void style_init(void)
style_init_reset(&styles->scrollbar);
lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_COVER);
lv_style_set_bg_color(&styles->scrollbar, (IS_LIGHT ? lv_color_hex(0xcccfd1) : lv_color_hex(0x777f85)));
lv_style_set_bg_color(&styles->scrollbar, lv_color_grey());
lv_style_set_radius(&styles->scrollbar, LV_RADIUS_CIRCLE);
lv_style_set_pad_right(&styles->scrollbar, LV_DPX(7));
lv_style_set_pad_top(&styles->scrollbar, LV_DPX(7));
@@ -242,38 +224,35 @@ static void style_init(void)
style_init_reset(&styles->card);
lv_style_set_radius(&styles->card, RADIUS_DEFAULT);
lv_style_set_bg_opa(&styles->card, LV_OPA_COVER);
lv_style_set_bg_color(&styles->card, CARD_COLOR);
lv_style_set_border_color(&styles->card, CARD_BORDER_COLOR);
lv_style_set_bg_color(&styles->card, lv_color_white());
lv_style_set_border_color(&styles->card, color_primary_muted);
lv_style_set_border_width(&styles->card, BORDER_WIDTH);
lv_style_set_border_post(&styles->card, true);
lv_style_set_text_color(&styles->card, CARD_TEXT_COLOR);
lv_style_set_text_color(&styles->card, lv_color_grey_darken_4());
lv_style_set_pad_all(&styles->card, PAD_DEF);
lv_style_set_pad_row(&styles->card, PAD_DEF);
lv_style_set_pad_row(&styles->card, PAD_DEF / 4 + 2);
lv_style_set_pad_column(&styles->card, PAD_DEF);
lv_style_set_line_color(&styles->card, COLOR_GRAY);
lv_style_set_line_color(&styles->card, lv_color_grey());
lv_style_set_line_width(&styles->card, LV_DPX(1));
style_init_reset(&styles->focus_outline);
lv_style_set_outline_color(&styles->focus_outline, theme.color_primary);
lv_style_set_outline_width(&styles->focus_outline, OUTLINE_WIDTH);
lv_style_set_outline_opa(&styles->focus_outline, LV_OPA_50);
style_init_reset(&styles->outline_primary);
lv_style_set_outline_color(&styles->outline_primary, color_primary_accent);
lv_style_set_outline_width(&styles->outline_primary, OUTLINE_WIDTH);
lv_style_set_outline_opa(&styles->outline_primary, LV_OPA_50);
style_init_reset(&styles->edit_outline);
lv_style_set_outline_color(&styles->edit_outline, theme.color_secondary);
lv_style_set_outline_width(&styles->edit_outline, OUTLINE_WIDTH);
lv_style_set_outline_opa(&styles->edit_outline, LV_OPA_50);
style_init_reset(&styles->outline_secondary);
lv_style_set_outline_color(&styles->outline_secondary, color_secondary_muted);
lv_style_set_outline_width(&styles->outline_secondary, OUTLINE_WIDTH);
lv_style_set_outline_opa(&styles->outline_secondary, LV_OPA_50);
style_init_reset(&styles->btn);
lv_style_set_radius(&styles->btn, LV_DPX(14));
lv_style_set_radius(&styles->btn, LV_DPX(16));
lv_style_set_bg_opa(&styles->btn, LV_OPA_COVER);
lv_style_set_bg_color(&styles->btn, COLOR_GRAY);
lv_style_set_shadow_color(&styles->btn, COLOR_GRAY);
lv_style_set_bg_color(&styles->btn, lv_color_grey());
lv_style_set_shadow_color(&styles->btn, lv_color_grey_lighten_2());
lv_style_set_shadow_width(&styles->btn, 1);
lv_style_set_shadow_ofs_y(&styles->btn, LV_DPX(4));
// lv_style_set_border_color(&styles->btn, COLOR_GRAY);
// lv_style_set_border_width(&styles->btn, 4);
// lv_style_set_border_side(&styles->btn, LV_BORDER_SIDE_BOTTOM);
lv_style_set_text_color(&styles->btn, CARD_TEXT_COLOR);
lv_style_set_text_color(&styles->btn, lv_color_grey_darken_4());
lv_style_set_pad_hor(&styles->btn, LV_DPX(40));
lv_style_set_pad_ver(&styles->btn, LV_DPX(15));
lv_style_set_pad_column(&styles->btn, LV_DPX(5));
@@ -283,13 +262,16 @@ static void style_init(void)
static lv_color_filter_dsc_t dark_filter;
lv_color_filter_dsc_init(&dark_filter, dark_color_filter_cb);
static lv_color_filter_dsc_t grey_filter;
lv_color_filter_dsc_init(&grey_filter, grey_filter_cb);
style_init_reset(&styles->pressed);
lv_style_set_color_filter_dsc(&styles->pressed, &dark_filter);
lv_style_set_color_filter_opa(&styles->pressed, 35);
style_init_reset(&styles->disabled);
// lv_style_set_color_filter_dsc(&styles->disabled, gray_filter);
// lv_style_set_color_filter_opa(&styles->disabled, LV_OPA_50);
lv_style_set_color_filter_dsc(&styles->disabled, &grey_filter);
lv_style_set_color_filter_opa(&styles->disabled, LV_OPA_70);
style_init_reset(&styles->clip_corner);
lv_style_set_clip_corner(&styles->clip_corner, true);
@@ -300,9 +282,8 @@ static void style_init(void)
lv_style_set_pad_column(&styles->pad_normal, PAD_DEF);
style_init_reset(&styles->pad_small);
lv_style_set_pad_all(&styles->pad_small, LV_DPX(10));
lv_style_set_pad_row(&styles->pad_small, LV_DPX(5));
lv_style_set_pad_column(&styles->pad_small, LV_DPX(5));
lv_style_set_pad_all(&styles->pad_small, PAD_DEF / 2 + 2);
lv_style_set_pad_gap(&styles->pad_small, PAD_DEF / 2 + 2);
style_init_reset(&styles->pad_gap);
lv_style_set_pad_row(&styles->pad_gap, LV_DPX(10));
@@ -323,34 +304,34 @@ static void style_init(void)
lv_style_set_pad_column(&styles->pad_zero, 0);
style_init_reset(&styles->bg_color_primary);
lv_style_set_bg_color(&styles->bg_color_primary, theme.color_primary);
lv_style_set_bg_color(&styles->bg_color_primary, color_primary_accent);
lv_style_set_text_color(&styles->bg_color_primary, lv_color_white());
lv_style_set_content_color(&styles->bg_color_primary, lv_color_white());
lv_style_set_bg_opa(&styles->bg_color_primary, LV_OPA_COVER);
style_init_reset(&styles->bg_color_primary_light);
lv_style_set_bg_color(&styles->bg_color_primary_light, lv_color_lighten(theme.color_primary, LV_OPA_90));
lv_style_set_text_color(&styles->bg_color_primary_light, theme.color_primary);
lv_style_set_content_color(&styles->bg_color_primary_light, theme.color_primary);
lv_style_set_bg_opa(&styles->bg_color_primary_light, LV_OPA_COVER);
style_init_reset(&styles->bg_color_primary_muted);
lv_style_set_bg_color(&styles->bg_color_primary_muted, color_primary_muted);
lv_style_set_text_color(&styles->bg_color_primary_muted, color_primary_accent);
lv_style_set_content_color(&styles->bg_color_primary_muted, color_primary_accent);
lv_style_set_bg_opa(&styles->bg_color_primary_muted, LV_OPA_COVER);
style_init_reset(&styles->bg_color_secondary);
lv_style_set_bg_color(&styles->bg_color_secondary, theme.color_secondary);
lv_style_set_bg_color(&styles->bg_color_secondary, color_secondary_accent);
lv_style_set_text_color(&styles->bg_color_secondary, lv_color_white());
lv_style_set_content_color(&styles->bg_color_secondary, lv_color_white());
lv_style_set_bg_opa(&styles->bg_color_secondary, LV_OPA_COVER);
style_init_reset(&styles->bg_color_gray);
lv_style_set_bg_color(&styles->bg_color_gray, COLOR_GRAY);
lv_style_set_bg_opa(&styles->bg_color_gray, LV_OPA_COVER);
lv_style_set_text_color(&styles->bg_color_gray, CARD_TEXT_COLOR);
lv_style_set_content_color(&styles->bg_color_gray, CARD_TEXT_COLOR);
style_init_reset(&styles->bg_color_grey);
lv_style_set_bg_color(&styles->bg_color_grey, COLOR_GREY);
lv_style_set_bg_opa(&styles->bg_color_grey, LV_OPA_COVER);
lv_style_set_text_color(&styles->bg_color_grey, lv_color_grey_darken_4());
lv_style_set_content_color(&styles->bg_color_grey, lv_color_grey_darken_4());
style_init_reset(&styles->bg_color_white);
lv_style_set_bg_color(&styles->bg_color_white, lv_color_white());
lv_style_set_bg_opa(&styles->bg_color_white, LV_OPA_COVER);
lv_style_set_text_color(&styles->bg_color_white, CARD_TEXT_COLOR);
lv_style_set_content_color(&styles->bg_color_white, CARD_TEXT_COLOR);
lv_style_set_text_color(&styles->bg_color_white, lv_color_grey_darken_4());
lv_style_set_content_color(&styles->bg_color_white, lv_color_grey_darken_4());
style_init_reset(&styles->circle);
lv_style_set_radius(&styles->circle, LV_RADIUS_CIRCLE);
@@ -365,9 +346,9 @@ static void style_init(void)
#endif
style_init_reset(&styles->knob);
lv_style_set_bg_color(&styles->knob, IS_LIGHT ? theme.color_primary : lv_color_white());
lv_style_set_bg_color(&styles->knob, color_primary_accent);
lv_style_set_bg_opa(&styles->knob, LV_OPA_COVER);
lv_style_set_pad_all(&styles->knob, LV_DPX(5));
lv_style_set_pad_all(&styles->knob, LV_DPX(6));
lv_style_set_radius(&styles->knob, LV_RADIUS_CIRCLE);
style_init_reset(&styles->anim);
@@ -375,19 +356,19 @@ static void style_init(void)
#if LV_USE_ARC
style_init_reset(&styles->arc_indic);
lv_style_set_arc_color(&styles->arc_indic, COLOR_GRAY);
lv_style_set_arc_color(&styles->arc_indic, COLOR_GREY);
lv_style_set_arc_width(&styles->arc_indic, LV_DPX(15));
lv_style_set_arc_rounded(&styles->arc_indic, true);
style_init_reset(&styles->arc_indic_primary);
lv_style_set_arc_color(&styles->arc_indic_primary, theme.color_primary);
lv_style_set_arc_color(&styles->arc_indic_primary, color_primary_accent);
#endif
#if LV_USE_CHECKBOX
style_init_reset(&styles->cb_marker);
lv_style_set_pad_all(&styles->cb_marker, LV_DPX(3));
lv_style_set_border_width(&styles->cb_marker, BORDER_WIDTH);
lv_style_set_border_color(&styles->cb_marker, theme.color_primary);
lv_style_set_border_color(&styles->cb_marker, color_primary_accent);
lv_style_set_bg_color(&styles->cb_marker, lv_color_white());
lv_style_set_bg_opa(&styles->cb_marker, LV_OPA_COVER);
lv_style_set_radius(&styles->cb_marker, RADIUS_DEFAULT / 2);
@@ -421,13 +402,13 @@ static void style_init(void)
#if LV_USE_METER
style_init_reset(&styles->meter_marker);
lv_style_set_line_width(&styles->meter_marker, LV_DPX(5));
lv_style_set_line_color(&styles->meter_marker, CARD_TEXT_COLOR);
lv_style_set_line_color(&styles->meter_marker, lv_color_grey_darken_4());
lv_style_set_size(&styles->meter_marker, LV_DPX(20));
lv_style_set_pad_left(&styles->meter_marker, LV_DPX(15));
style_init_reset(&styles->meter_indic);
lv_style_set_radius(&styles->meter_indic, LV_RADIUS_CIRCLE);
lv_style_set_bg_color(&styles->meter_indic, CARD_TEXT_COLOR);
lv_style_set_bg_color(&styles->meter_indic, lv_color_grey_darken_4());
lv_style_set_bg_opa(&styles->meter_indic, LV_OPA_COVER);
lv_style_set_size(&styles->meter_indic, LV_DPX(15));
#endif
@@ -435,26 +416,26 @@ static void style_init(void)
#if LV_USE_TABLE
style_init_reset(&styles->table_cell);
lv_style_set_border_width(&styles->table_cell, LV_DPX(1));
lv_style_set_border_color(&styles->table_cell, CARD_BORDER_COLOR);
lv_style_set_border_color(&styles->table_cell, color_primary_muted);
lv_style_set_border_side(&styles->table_cell, LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM );
#endif
#if LV_USE_TEXTAREA
style_init_reset(&styles->ta_cursor);
lv_style_set_border_color(&styles->ta_cursor, COLOR_BG_SEC_TEXT);
lv_style_set_border_color(&styles->ta_cursor, COLOR_SCR_TEXT);
lv_style_set_border_width(&styles->ta_cursor, LV_DPX(2));
lv_style_set_pad_left(&styles->ta_cursor, LV_DPX(1));
lv_style_set_border_side(&styles->ta_cursor, LV_BORDER_SIDE_LEFT);
lv_style_set_anim_time(&styles->ta_cursor, 400);
style_init_reset(&styles->ta_placeholder);
lv_style_set_text_color(&styles->ta_placeholder, IS_LIGHT ? COLOR_BG_TEXT_DIS : lv_color_hex(0xa1adbd));
lv_style_set_text_color(&styles->ta_placeholder, lv_color_grey_lighten_3());
#endif
#if LV_USE_CALENDAR
style_init_reset(&styles->calendar_day);
lv_style_set_border_width(&styles->calendar_day, LV_DPX(1));
lv_style_set_border_color(&styles->calendar_day, CARD_BORDER_COLOR);
lv_style_set_border_color(&styles->calendar_day, color_primary_muted);
lv_style_set_bg_opa(&styles->calendar_day, LV_OPA_COVER);
#endif
@@ -471,10 +452,11 @@ static void style_init(void)
#if LV_USE_TABVIEW
style_init_reset(&styles->tab_btn);
lv_style_set_border_color(&styles->tab_btn, theme.color_primary);
lv_style_set_border_width(&styles->tab_btn, lv_dpx(3));
lv_style_set_border_color(&styles->tab_btn, color_primary_accent);
lv_style_set_border_width(&styles->tab_btn, BORDER_WIDTH * 2);
lv_style_set_border_side(&styles->tab_btn, LV_BORDER_SIDE_BOTTOM);
#endif
#if LV_USE_LIST
style_init_reset(&styles->list_bg);
lv_style_set_pad_hor(&styles->list_bg, PAD_DEF);
@@ -484,7 +466,7 @@ static void style_init(void)
style_init_reset(&styles->list_btn);
lv_style_set_border_width(&styles->list_btn, LV_DPX(1));
lv_style_set_border_color(&styles->list_btn, CARD_BORDER_COLOR);
lv_style_set_border_color(&styles->list_btn, color_primary_muted);
lv_style_set_border_side(&styles->list_btn, LV_BORDER_SIDE_BOTTOM);
lv_style_set_pad_all(&styles->list_btn, PAD_DEF);
lv_style_set_pad_column(&styles->list_btn, PAD_DEF);
@@ -511,9 +493,8 @@ static void style_init(void)
* GLOBAL FUNCTIONS
**********************/
lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary,
const lv_font_t * font_small, const lv_font_t * font_normal,
const lv_font_t * font_large)
lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_palette_t palette_primary, lv_color_palette_t palette_secondary,
const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large)
{
/* This trick is required only to avoid the garbage collection of
@@ -525,8 +506,8 @@ lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, l
}
theme.disp = disp;
theme.color_primary = color_primary;
theme.color_secondary = color_secondary;
theme.palette_primary = palette_primary;
theme.palette_secondary = palette_secondary;
theme.font_small = font_small;
theme.font_normal = font_normal;
theme.font_large = font_large;
@@ -561,7 +542,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_t * parent = lv_obj_get_parent(obj);
/*Tabview content area*/
if(lv_obj_check_type(parent, &lv_tabview_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_gap);
return;
}
@@ -578,7 +559,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_WIN
/*Header*/
if(lv_obj_get_child_id(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_normal);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->text_align_center);
return;
@@ -633,7 +614,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUSED, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUSED, &styles->outline_primary);
return;
}
#endif
@@ -642,26 +623,26 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_white);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->bg_color_white);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary_light);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary_muted);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->tab_btn);
return;
}
#endif
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->btn);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->outline_primary);
}
#endif
#if LV_USE_BAR
else if(lv_obj_check_type(obj, &lv_bar_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_primary_muted);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
}
@@ -669,12 +650,12 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_SLIDER
else if(lv_obj_check_type(obj, &lv_slider_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_primary_muted);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_delayed);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->transition_normal);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->knob);
@@ -705,7 +686,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_CHECKBOX
else if(lv_obj_check_type(obj, &lv_checkbox_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_gap);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->cb_bg_outline_pad);
lv_obj_add_style(obj, LV_PART_MARKER, LV_STATE_DISABLED, &styles->disabled);
lv_obj_add_style(obj, LV_PART_MARKER, LV_STATE_DEFAULT, &styles->cb_marker);
@@ -722,10 +703,10 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_SWITCH
else if(lv_obj_check_type(obj, &lv_switch_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DISABLED, &styles->disabled);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DISABLED, &styles->disabled);
@@ -755,8 +736,8 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->anim);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->line_space_large);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->text_align_center);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->bg_color_primary);
}
#endif
@@ -764,13 +745,13 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_DROPDOWN
else if(lv_obj_check_type(obj, &lv_dropdown_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_normal);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_delayed);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->transition_normal);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_normal);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
}
else if(lv_obj_check_type(obj, &lv_dropdown_list_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
@@ -778,7 +759,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->bg_color_primary);
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_PRESSED, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_PRESSED, &styles->bg_color_grey);
}
#endif
@@ -786,7 +767,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
else if(lv_obj_check_type(obj, &lv_label_class)) {
#if LV_USE_LIST
if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_list_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->list_item_grow);
}
#endif
@@ -813,8 +794,9 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_TEXTAREA
else if(lv_obj_check_type(obj, &lv_textarea_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
lv_obj_add_style(obj, LV_PART_MARKER, LV_STATE_FOCUSED, &styles->ta_cursor);
@@ -826,12 +808,12 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
else if(lv_obj_check_type(obj, &lv_calendar_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->calendar_day);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DISABLED, &styles->disabled);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->outline_primary);
}
#endif
@@ -839,13 +821,13 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
else if(lv_obj_check_type(obj, &lv_keyboard_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->btn);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->bg_color_white);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUSED, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_grey);
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUSED, &styles->outline_primary);
}
#endif
#if LV_USE_LIST
@@ -866,9 +848,9 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_SPINBOX
else if(lv_obj_check_type(obj, &lv_spinbox_class)) {
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->focus_outline);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->edit_outline);
lv_obj_add_style(obj, LV_PART_MARKER, LV_STATE_DEFAULT, &styles->bg_color_gray);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
lv_obj_add_style(obj, LV_PART_MARKER, LV_STATE_DEFAULT, &styles->bg_color_grey);
}
#endif
#if LV_USE_TILEVIEW
@@ -904,10 +886,6 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
* STATIC FUNCTIONS
**********************/
static lv_color_t gray_filter(lv_color_t color, lv_opa_t opa)
{
return lv_color_mix(lv_color_grey_lighten_2(), color, opa);
}
static void style_init_reset(lv_style_t * style)
{
if(inited) lv_style_reset(style);

View File

@@ -36,9 +36,8 @@ extern "C" {
* @param font pointer to a font to use.
* @return a pointer to reference this theme later
*/
lv_theme_t * lv_theme_default_init(lv_disp_t * disp,lv_color_t color_primary, lv_color_t color_secondary,
const lv_font_t * font_small, const lv_font_t * font_normal,
const lv_font_t * font_large);
lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_palette_t palette_primary, lv_color_palette_t palette_secondary,
const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large);
bool lv_theme_default_is_inited(void);

View File

@@ -127,7 +127,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
draw_dsc->shadow_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
draw_dsc->shadow_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part);
draw_dsc->shadow_spread = lv_obj_get_style_shadow_spread(obj, part);
draw_dsc->shadow_color = lv_obj_get_style_shadow_color(obj, part);
draw_dsc->shadow_color = lv_obj_get_style_shadow_color_filtered(obj, part);
}
}
}

View File

@@ -100,6 +100,18 @@ const lv_font_t * lv_theme_get_font_large(lv_obj_t * obj)
return th ? th->font_large : LV_FONT_DEFAULT;
}
lv_color_palette_t lv_theme_get_palette_primary(lv_obj_t * obj)
{
lv_theme_t * th = lv_theme_get_from_obj(obj);
return th ? th->palette_primary : LV_COLOR_PALETTE_BLUE_GREY;
}
lv_color_palette_t lv_theme_get_palette_secondary(lv_obj_t * obj)
{
lv_theme_t * th = lv_theme_get_from_obj(obj);
return th ? th->palette_secondary : LV_COLOR_PALETTE_BLUE;
}
lv_color_t lv_theme_get_color_primary(lv_obj_t * obj)
{
lv_theme_t * th = lv_theme_get_from_obj(obj);

View File

@@ -33,6 +33,8 @@ typedef struct _lv_theme_t {
struct _lv_theme_t * parent; /**< Apply the current theme's style on top of this theme.*/
void * user_data;
struct _lv_disp_t * disp;
lv_color_palette_t palette_primary;
lv_color_palette_t palette_secondary;
lv_color_t color_primary;
lv_color_t color_secondary;
const lv_font_t * font_small;
@@ -97,6 +99,10 @@ const lv_font_t * lv_theme_get_font_normal(lv_obj_t * obj);
*/
const lv_font_t * lv_theme_get_font_large(lv_obj_t * obj);
lv_color_palette_t lv_theme_get_palette_primary(lv_obj_t * obj);
lv_color_palette_t lv_theme_get_palette_secondary(lv_obj_t * obj);
/**
* Get the primary color of the theme
* @return the color

View File

@@ -140,7 +140,7 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
#if LV_USE_THEME_DEFAULT
if(lv_theme_default_is_inited() == false) {
disp->theme = lv_theme_default_init(disp, lv_color_blue(), lv_color_purple(), LV_FONT_DEFAULT, LV_FONT_DEFAULT, LV_FONT_DEFAULT);
disp->theme = lv_theme_default_init(disp, LV_COLOR_PALETTE_BLUE_GREY, LV_COLOR_PALETTE_BLUE, LV_FONT_DEFAULT, LV_FONT_DEFAULT, LV_FONT_DEFAULT);
}
#endif

View File

@@ -7,6 +7,7 @@
* INCLUDES
*********************/
#include "lv_color.h"
#include "lv_log.h"
/*********************
* DEFINES
@@ -269,3 +270,365 @@ lv_color_hsv_t lv_color_to_hsv(lv_color_t color)
color32.full = lv_color_to32(color);
return lv_color_rgb_to_hsv(color32.ch.red, color32.ch.green, color32.ch.blue);
}
lv_color_t lv_color_get_palette_main(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red();
case LV_COLOR_PALETTE_PINK: return lv_color_pink();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal();
case LV_COLOR_PALETTE_GREEN: return lv_color_green();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green();
case LV_COLOR_PALETTE_LIME: return lv_color_lime();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey();
case LV_COLOR_PALETTE_GREY: return lv_color_grey();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_lighten_1(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_lighten_1();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_lighten_1();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_lighten_1();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_lighten_1();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_lighten_1();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_lighten_1();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_lighten_1();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_lighten_1();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_lighten_1();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_lighten_1();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_lighten_1();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_lighten_1();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_lighten_1();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_lighten_1();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_lighten_1();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_lighten_1();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_lighten_1();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_lighten_1();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_lighten_1();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_lighten_2(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_lighten_2();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_lighten_2();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_lighten_2();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_lighten_2();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_lighten_2();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_lighten_2();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_lighten_2();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_lighten_2();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_lighten_2();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_lighten_2();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_lighten_2();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_lighten_2();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_lighten_2();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_lighten_2();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_lighten_2();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_lighten_2();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_lighten_2();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_lighten_2();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_lighten_2();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_lighten_3(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_lighten_3();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_lighten_3();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_lighten_3();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_lighten_3();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_lighten_3();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_lighten_3();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_lighten_3();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_lighten_3();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_lighten_3();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_lighten_3();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_lighten_3();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_lighten_3();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_lighten_3();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_lighten_3();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_lighten_3();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_lighten_3();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_lighten_3();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_lighten_3();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_lighten_3();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_lighten_4(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_lighten_4();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_lighten_4();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_lighten_4();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_lighten_4();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_lighten_4();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_lighten_4();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_lighten_4();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_lighten_4();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_lighten_4();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_lighten_4();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_lighten_4();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_lighten_4();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_lighten_4();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_lighten_4();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_lighten_4();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_lighten_4();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_lighten_4();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_lighten_4();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_lighten_4();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_lighten_5(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_lighten_5();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_lighten_5();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_lighten_5();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_lighten_5();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_lighten_5();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_lighten_5();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_lighten_5();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_lighten_5();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_lighten_5();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_lighten_5();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_lighten_5();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_lighten_5();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_lighten_5();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_lighten_5();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_lighten_5();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_lighten_5();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_lighten_5();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_lighten_5();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_lighten_5();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_darken_1(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_darken_1();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_darken_1();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_darken_1();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_darken_1();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_darken_1();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_darken_1();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_darken_1();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_darken_1();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_darken_1();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_darken_1();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_darken_1();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_darken_1();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_darken_1();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_darken_1();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_darken_1();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_darken_1();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_darken_1();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_darken_1();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_darken_1();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_darken_2(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_darken_2();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_darken_2();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_darken_2();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_darken_2();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_darken_2();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_darken_2();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_darken_2();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_darken_2();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_darken_2();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_darken_2();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_darken_2();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_darken_2();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_darken_2();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_darken_2();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_darken_2();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_darken_2();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_darken_2();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_darken_2();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_darken_2();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_darken_3(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_darken_3();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_darken_3();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_darken_3();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_darken_3();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_darken_3();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_darken_3();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_darken_3();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_darken_3();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_darken_3();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_darken_3();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_darken_3();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_darken_3();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_darken_3();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_darken_3();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_darken_3();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_darken_3();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_darken_3();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_darken_3();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_darken_3();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_darken_4(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_darken_4();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_darken_4();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_darken_4();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_darken_4();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_darken_4();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_darken_4();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_darken_4();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_darken_4();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_darken_4();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_darken_4();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_darken_4();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_darken_4();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_darken_4();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_darken_4();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_darken_4();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_darken_4();
case LV_COLOR_PALETTE_BROWN: return lv_color_brown_darken_4();
case LV_COLOR_PALETTE_BLUE_GREY: return lv_color_blue_grey_darken_4();
case LV_COLOR_PALETTE_GREY: return lv_color_grey_darken_4();
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_accent_1();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_accent_1();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_accent_1();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_accent_1();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_accent_1();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_accent_1();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_accent_1();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_accent_1();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_accent_1();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_accent_1();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_accent_1();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_accent_1();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_accent_1();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_accent_1();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_1();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_1();
default:
LV_LOG_WARN("Color palette %d has no accent colors");
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_accent_2(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_accent_2();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_accent_2();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_accent_2();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_accent_2();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_accent_2();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_accent_2();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_accent_2();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_accent_2();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_accent_2();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_accent_2();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_accent_2();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_accent_2();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_accent_2();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_accent_2();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_2();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_2();
default:
LV_LOG_WARN("Color palette %d has no accent colors");
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_accent_3(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_accent_3();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_accent_3();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_accent_3();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_accent_3();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_accent_3();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_accent_3();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_accent_3();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_accent_3();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_accent_3();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_accent_3();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_accent_3();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_accent_3();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_accent_3();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_accent_3();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_3();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_3();
default:
LV_LOG_WARN("Color palette %d has no accent colors");
}
return lv_color_black();
}
lv_color_t lv_color_get_palette_accent_4(lv_color_palette_t palette)
{
switch(palette) {
case LV_COLOR_PALETTE_RED: return lv_color_red_accent_4();
case LV_COLOR_PALETTE_PINK: return lv_color_pink_accent_4();
case LV_COLOR_PALETTE_PURPLE: return lv_color_purple_accent_4();
case LV_COLOR_PALETTE_DEEP_PURPLE: return lv_color_deep_purple_accent_4();
case LV_COLOR_PALETTE_INDIGO: return lv_color_indigo_accent_4();
case LV_COLOR_PALETTE_BLUE: return lv_color_blue_accent_4();
case LV_COLOR_PALETTE_LIGHT_BLUE: return lv_color_light_blue_accent_4();
case LV_COLOR_PALETTE_CYAN: return lv_color_cyan_accent_4();
case LV_COLOR_PALETTE_TEAL: return lv_color_teal_accent_4();
case LV_COLOR_PALETTE_GREEN: return lv_color_green_accent_4();
case LV_COLOR_PALETTE_LIGHT_GREEN: return lv_color_light_green_accent_4();
case LV_COLOR_PALETTE_LIME: return lv_color_lime_accent_4();
case LV_COLOR_PALETTE_YELLOW: return lv_color_yellow_accent_4();
case LV_COLOR_PALETTE_AMBER: return lv_color_amber_accent_4();
case LV_COLOR_PALETTE_ORANGE: return lv_color_orange_accent_4();
case LV_COLOR_PALETTE_DEEP_ORANGE: return lv_color_deep_orange_accent_4();
default:
LV_LOG_WARN("Color palette %d has no accent colors");
}
return lv_color_black();
}

View File

@@ -274,6 +274,29 @@ typedef struct _lv_color_filter_dsc_t {
void * user_data;
}lv_color_filter_dsc_t;
typedef enum {
LV_COLOR_PALETTE_RED,
LV_COLOR_PALETTE_PINK,
LV_COLOR_PALETTE_PURPLE,
LV_COLOR_PALETTE_DEEP_PURPLE,
LV_COLOR_PALETTE_INDIGO,
LV_COLOR_PALETTE_BLUE,
LV_COLOR_PALETTE_LIGHT_BLUE,
LV_COLOR_PALETTE_CYAN,
LV_COLOR_PALETTE_TEAL,
LV_COLOR_PALETTE_GREEN,
LV_COLOR_PALETTE_LIGHT_GREEN,
LV_COLOR_PALETTE_LIME,
LV_COLOR_PALETTE_YELLOW,
LV_COLOR_PALETTE_AMBER,
LV_COLOR_PALETTE_ORANGE,
LV_COLOR_PALETTE_DEEP_ORANGE,
LV_COLOR_PALETTE_BROWN,
LV_COLOR_PALETTE_BLUE_GREY,
LV_COLOR_PALETTE_GREY,
}lv_color_palette_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
@@ -631,6 +654,33 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8);
*/
lv_color_hsv_t lv_color_to_hsv(lv_color_t color);
lv_color_t lv_color_get_palette_main(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_lighten_1(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_lighten_2(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_lighten_3(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_lighten_4(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_lighten_5(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_darken_1(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_darken_2(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_darken_3(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_darken_4(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_accent_1(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_accent_2(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_accent_3(lv_color_palette_t palette);
lv_color_t lv_color_get_palette_accent_4(lv_color_palette_t palette);
/**********************
* PREDEFINED COLORS

View File

@@ -89,8 +89,8 @@ static void lv_slider_constructor(lv_obj_t * obj, const lv_obj_t * copy)
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN);
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_ext_click_area(obj, lv_dpx(5));
lv_obj_set_height(obj, LV_DPI_DEF / 15);
lv_obj_set_ext_click_area(obj, LV_DPX(8));
lv_obj_set_height(obj, LV_DPX(10));
} else {
lv_slider_t * copy_slider = (lv_slider_t * ) copy;
lv_area_copy(&slider->left_knob_area, &copy_slider->left_knob_area);