feat(color): use colors from material design
Use function instead of color macros
This commit is contained in:
@@ -12,8 +12,8 @@ void lv_example_style_1(void)
|
||||
|
||||
/*Make a gradient*/
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_grad_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
lv_style_set_bg_grad_color(&style, lv_color_blue());
|
||||
lv_style_set_bg_grad_dir(&style, LV_GRAD_DIR_VER);
|
||||
|
||||
/*Shift the gradient to the bottom*/
|
||||
|
||||
@@ -12,10 +12,10 @@ typedef int _keep_pedantic_happy;
|
||||
// /*Set a background color and a radius*/
|
||||
// lv_style_set_radius(&style, LV_STATE_DEFAULT, 5);
|
||||
// lv_style_set_bg_opa(&style, LV_STATE_DEFAULT, LV_OPA_COVER);
|
||||
// lv_style_set_bg_color(&style, LV_STATE_DEFAULT, LV_COLOR_SILVER);
|
||||
// lv_style_set_bg_color(&style, LV_STATE_DEFAULT, lv_color_grey_lighten_3());
|
||||
//
|
||||
// /*Set different background color in pressed state*/
|
||||
// lv_style_set_bg_color(&style, LV_STATE_PRESSED, LV_COLOR_GRAY);
|
||||
// lv_style_set_bg_color(&style, LV_STATE_PRESSED, lv_color_grey());
|
||||
//
|
||||
// /*Set different transition time in default and pressed state
|
||||
// *fast press, slower revert to default*/
|
||||
|
||||
@@ -9,7 +9,7 @@ void lv_example_style_11(void)
|
||||
static lv_style_t style;
|
||||
lv_style_init(&style);
|
||||
|
||||
lv_style_set_arc_color(&style, LV_COLOR_RED);
|
||||
lv_style_set_arc_color(&style, lv_color_red());
|
||||
lv_style_set_arc_width(&style, 4);
|
||||
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ void lv_example_style_2(void)
|
||||
/*Set a background color and a radius*/
|
||||
lv_style_set_radius(&style, 10);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
|
||||
/*Add border to the bottom+right*/
|
||||
lv_style_set_border_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_border_color(&style, lv_color_blue());
|
||||
lv_style_set_border_width(&style, 5);
|
||||
lv_style_set_border_opa(&style, LV_OPA_50);
|
||||
lv_style_set_border_side(&style, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT);
|
||||
|
||||
@@ -12,11 +12,11 @@ void lv_example_style_3(void)
|
||||
/*Set a background color and a radius*/
|
||||
lv_style_set_radius(&style, 5);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
|
||||
/*Add outline*/
|
||||
lv_style_set_outline_width(&style, 2);
|
||||
lv_style_set_outline_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_outline_color(&style, lv_color_blue());
|
||||
lv_style_set_outline_pad(&style, 8);
|
||||
|
||||
/*Create an object with the new style*/
|
||||
|
||||
@@ -12,11 +12,11 @@ void lv_example_style_4(void)
|
||||
/*Set a background color and a radius*/
|
||||
lv_style_set_radius(&style, 5);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
|
||||
/*Add a shadow*/
|
||||
lv_style_set_shadow_width(&style, 8);
|
||||
lv_style_set_shadow_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_shadow_color(&style, lv_color_blue());
|
||||
lv_style_set_shadow_ofs_x(&style, 10);
|
||||
lv_style_set_shadow_ofs_y(&style, 20);
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ void lv_example_style_6(void)
|
||||
/*Set a background color and a radius*/
|
||||
lv_style_set_radius(&style, 5);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
|
||||
/*Add a value text properties*/
|
||||
lv_style_set_content_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_content_color(&style, lv_color_blue());
|
||||
lv_style_set_content_align(&style, LV_ALIGN_IN_BOTTOM_RIGHT);
|
||||
lv_style_set_content_ofs_x(&style, -5);
|
||||
lv_style_set_content_ofs_y(&style, -5);
|
||||
|
||||
@@ -11,12 +11,12 @@ void lv_example_style_7(void)
|
||||
|
||||
lv_style_set_radius(&style, 5);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
lv_style_set_border_width(&style, 2);
|
||||
lv_style_set_border_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_border_color(&style, lv_color_blue());
|
||||
lv_style_set_pad_all(&style, 10);
|
||||
|
||||
lv_style_set_text_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_text_color(&style, lv_color_blue());
|
||||
lv_style_set_text_letter_space(&style, 5);
|
||||
lv_style_set_text_line_space(&style, 20);
|
||||
lv_style_set_text_decor(&style, LV_TEXT_DECOR_UNDERLINE);
|
||||
|
||||
@@ -9,7 +9,7 @@ void lv_example_style_8(void)
|
||||
static lv_style_t style;
|
||||
lv_style_init(&style);
|
||||
|
||||
lv_style_set_line_color(&style, LV_COLOR_GRAY);
|
||||
lv_style_set_line_color(&style, lv_color_grey());
|
||||
lv_style_set_line_width(&style, 6);
|
||||
lv_style_set_line_rounded(&style, true);
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ void lv_example_style_9(void)
|
||||
/*Set a background color and a radius*/
|
||||
lv_style_set_radius(&style, 5);
|
||||
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&style, LV_COLOR_SILVER);
|
||||
lv_style_set_bg_color(&style, lv_color_grey_lighten_3());
|
||||
lv_style_set_border_width(&style, 2);
|
||||
lv_style_set_border_color(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_border_color(&style, lv_color_blue());
|
||||
|
||||
// lv_style_set_pad_all(&style, 10);
|
||||
|
||||
lv_style_set_img_recolor(&style, LV_COLOR_BLUE);
|
||||
lv_style_set_img_recolor(&style, lv_color_blue());
|
||||
lv_style_set_img_recolor_opa(&style, LV_OPA_50);
|
||||
lv_style_set_transform_angle(&style, 300);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user