File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class Uplot(displayio.Group):
54
54
:param int height: plot box height in pixels
55
55
:param int padding: padding for the plot box in all directions
56
56
:param bool show_box: select if the plot box is displayed
57
+ :param int background_color: background color in HEX. Defaults to black ``0x000000``
57
58
58
59
"""
59
60
@@ -65,6 +66,7 @@ def __init__(
65
66
height : int = 100 ,
66
67
padding : int = 25 ,
67
68
show_box : bool = True ,
69
+ background_color : int = 0x000000 ,
68
70
) -> None :
69
71
if width not in range (50 , 481 ):
70
72
print ("Be sure to verify your values. Defaulting to width=100" )
@@ -123,7 +125,7 @@ def __init__(
123
125
self ._drawbox ()
124
126
125
127
self ._plot_palette = displayio .Palette (14 )
126
- self ._plot_palette [0 ] = 0x000000
128
+ self ._plot_palette [0 ] = background_color
127
129
self ._plot_palette [1 ] = 0xFFFFFF
128
130
self ._plot_palette [2 ] = self ._tickcolor
129
131
self ._plot_palette [3 ] = self ._barcolor
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ The Uplot will be used to display our graphics. The position and the size of the
31
31
could vary. This allows us to have more than 1 plot at the same time in the screen.
32
32
Every one of them with different characteristics or graphs.
33
33
34
+ Options available are:
35
+ * backround_color: Allows to change the background color. The default is black.
36
+
34
37
We tell the microcontroller to display our plot:
35
38
36
39
.. code-block :: python
You can’t perform that action at this time.
0 commit comments