@@ -355,6 +355,7 @@ def _create_label_group(
355
355
font ,
356
356
scale ,
357
357
height_adjustment ,
358
+ background_color = None ,
358
359
color = 0xFFFFFF ,
359
360
width_adjustment = 2 ,
360
361
line_spacing = 0.75 ,
@@ -365,7 +366,12 @@ def _create_label_group(
365
366
font = load_font (font , text )
366
367
367
368
create_label_group = displayio .Group (scale = scale )
368
- create_label = self ._label .Label (font , text = text , line_spacing = line_spacing )
369
+ create_label = self ._label .Label (
370
+ font ,
371
+ text = text ,
372
+ line_spacing = line_spacing ,
373
+ background_color = background_color ,
374
+ )
369
375
_ , _ , width , _ = create_label .bounding_box
370
376
create_label .x = (self .display .width // (width_adjustment * scale )) - width // 2
371
377
create_label .y = int (self .display .height * (height_adjustment / scale ))
@@ -447,6 +453,8 @@ def show_business_card(
447
453
name_string = None ,
448
454
name_scale = 1 ,
449
455
name_font = terminalio .FONT ,
456
+ font_color = 0xFFFFFF ,
457
+ font_background_color = None ,
450
458
email_string_one = None ,
451
459
email_scale_one = 1 ,
452
460
email_font_one = terminalio .FONT ,
@@ -489,24 +497,30 @@ def show_business_card(
489
497
name_group = self ._create_label_group (
490
498
text = name_string ,
491
499
font = name_font ,
500
+ color = font_color ,
492
501
scale = name_scale ,
493
502
height_adjustment = 0.73 ,
503
+ background_color = font_background_color ,
494
504
)
495
505
business_card_label_groups .append (name_group )
496
506
if email_string_one :
497
507
email_one_group = self ._create_label_group (
498
508
text = email_string_one ,
499
509
font = email_font_one ,
510
+ color = font_color ,
500
511
scale = email_scale_one ,
501
512
height_adjustment = 0.84 ,
513
+ background_color = font_background_color ,
502
514
)
503
515
business_card_label_groups .append (email_one_group )
504
516
if email_string_two :
505
517
email_two_group = self ._create_label_group (
506
518
text = email_string_two ,
507
519
font = email_font_two ,
520
+ color = font_color ,
508
521
scale = email_scale_two ,
509
522
height_adjustment = 0.91 ,
523
+ background_color = font_background_color ,
510
524
)
511
525
business_card_label_groups .append (email_two_group )
512
526
0 commit comments