AnimatedPanel Reference¶
Bases: AnimatedGradient
Animated variant of :class:rich_gradient.panel.Panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
renderable
|
RenderableType
|
The renderable to display inside the panel. |
required |
colors
|
Optional[List[ColorType]]
|
Optional foreground color stops for the gradient.
[cli option: |
None
|
bg_colors
|
Optional[List[ColorType]]
|
Optional background color stops for the gradient.
[cli option: |
None
|
hues
|
int
|
Number of hues to generate when auto-selecting colors.
[cli option: |
5
|
rainbow
|
bool
|
If True, ignore |
False
|
repeat_scale
|
float
|
Stretch factor for gradient color stops. Higher values produce
a more gradual gradient. [cli option: |
4.0
|
title
|
Optional[Text | Text | TextType]
|
Optional panel title renderable. [cli option: |
None
|
title_align
|
AlignMethod
|
Alignment for the title text. Defaults to |
'center'
|
title_style
|
StyleType
|
Style applied to the highlighted title text.
[cli option: |
'bold'
|
subtitle
|
Optional[Text | Text | TextType]
|
Optional panel subtitle renderable. [cli option: |
None
|
subtitle_align
|
AlignMethod
|
Alignment for the subtitle text. Defaults to |
'right'
|
subtitle_style
|
StyleType
|
Style applied to the highlighted subtitle text.
[cli option: |
''
|
border_style
|
StyleType
|
Border style for the Rich panel. [cli option: |
''
|
justify
|
AlignMethod
|
Horizontal justification applied to the animated gradient.
[cli option: |
'left'
|
vertical_justify
|
VerticalAlignMethod
|
Vertical justification applied to the animated gradient.
[cli option: |
'middle'
|
box
|
Box
|
Rich box style for the panel border. Defaults to :data: |
ROUNDED
|
padding
|
Union[int, tuple[int, int], tuple[int, int, int, int]]
|
Panel padding. Can be a single integer or a tuple of up to four integers.
[cli option: |
(0, 1)
|
expand
|
bool
|
Whether the panel expands to available width. [cli option: |
True
|
style
|
StyleType
|
Base style for panel content. [cli option: |
''
|
width
|
Optional[int]
|
Optional explicit panel width. [cli option: |
None
|
height
|
Optional[int]
|
Optional explicit panel height. [cli option: |
None
|
safe_box
|
bool
|
Use “safe” box characters if True. [cli option: |
False
|
highlight_words
|
Optional[HighlightWordsType]
|
Word highlight configuration forwarded to the gradient.
[cli option: |
None
|
highlight_regex
|
Optional[HighlightRegexType]
|
Regex highlight configuration forwarded to the gradient.
[cli option: |
None
|
auto_refresh
|
bool
|
Whether |
True
|
refresh_per_second
|
(optional, float)
|
Target frames per second. Defaults to 20.0
[cli option: |
20.0
|
console
|
Optional[Console]
|
Explicit console to render to. Defaults to None.
[cli option: |
None
|
transient
|
(optional, bool)
|
Leave the screen clear after stopping if True.
[cli option: |
False
|
redirect_stdout
|
bool
|
Redirect stdout into the Live console.
[cli option: |
False
|
redirect_stderr
|
bool
|
Redirect stderr into the Live console.
[cli option: |
False
|
animate
|
bool | None
|
Toggle animation on or off. |
None
|
duration
|
Optional[float]
|
Optional duration in seconds for automatic stop. |
None
|
Source code in src/rich_gradient/animated_panel.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
panel
property
¶
Access the underlying Rich panel renderable.
__init__(renderable, colors=None, bg_colors=None, hues=5, rainbow=False, repeat_scale=4.0, expand=True, justify='left', vertical_justify='middle', highlight_words=None, highlight_regex=None, border_style='', box=ROUNDED, padding=(0, 1), width=None, height=None, style='', title=None, title_align='center', title_style='bold', subtitle=None, subtitle_align='right', subtitle_style='', safe_box=False, console=None, redirect_stdout=False, redirect_stderr=False, auto_refresh=True, refresh_per_second=20.0, transient=False, animate=None, duration=None)
¶
Initialize AnimatedPanel instance. See class docstring for details.
Source code in src/rich_gradient/animated_panel.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
_combine_highlight_regex(highlight_regex, title, title_style, subtitle, subtitle_style, box)
staticmethod
¶
Merge user-provided regex highlights with title/subtitle highlights.
Source code in src/rich_gradient/animated_panel.py
_get_subtitle_regex(box)
staticmethod
¶
Generate the regex used to highlight the subtitle row.
Source code in src/rich_gradient/animated_panel.py
_get_title_regex(box)
staticmethod
¶
Generate the regex used to highlight the title row.