tessella.widgets.style package
Submodules
tessella.widgets.style.border_radius module
- class tessella.widgets.style.border_radius.BorderRadius(top_left_radius=0, top_right_radius=0, bottom_left_radius=0, bottom_right_radius=0)[source]
Bases:
objectA dataclass that allows for setting the border radius of different corners separately.
- Parameters:
top_left_radius (int)
top_right_radius (int)
bottom_left_radius (int)
bottom_right_radius (int)
- top_left_radius
The border radius of the top left corner, in pixels.
- Type:
int
- top_right_radius
The border radius of the top right corner, in pixels.
- Type:
int
- bottom_left_radius
The border radius of the bottom left corner, in pixels.
- Type:
int
- bottom_right_radius
The border radius of the bottom right corner, in pixels.
- Type:
int
tessella.widgets.style.border_style module
- class tessella.widgets.style.border_style.BorderStyle(color='#343340', thickness=0, border_radius=None)[source]
Bases:
objectBorder styling for some widgets that support it.
- Parameters:
color (str)
thickness (int)
border_radius (BorderRadius | None)
- color
The color of the border.
- Type:
str
- thickness
The thickness of the border in pixels.
- Type:
int
- border_radius
A BorderRadius object representing the rounding on the corners of this widget.
- Type:
tessella.widgets.style.checkbox_style module
- class tessella.widgets.style.checkbox_style.CheckboxStyle(thumb_color='#ECECF2', active_color='#686898', inactive_color='#3A3946', border_radius=None, thumb_padding=3)[source]
Bases:
objectStyling object used to customize Checkbox widgets.
- Parameters:
thumb_color (str)
active_color (str)
inactive_color (str)
border_radius (BorderRadius | None)
thumb_padding (int)
- thumb_color
The color of the inner thumb, shown when the checkbox is checked.
- Type:
str
- active_color
The color of the checkbox’s box while it is being hovered.
- Type:
str
- inactive_color
The color of the checkbox’s box while it is not being hovered.
- Type:
str
- border_radius
The rounding on the corners of the box and the inner thumb.
- Type:
- thumb_padding
The spacing between the box and the inner thumb, in pixels.
- Type:
int
tessella.widgets.style.container_style module
- class tessella.widgets.style.container_style.ContainerStyle(color=None, border_style=None)[source]
Bases:
objectStyling for the Container widget.
- Parameters:
color (str | None)
border_style (BorderStyle | None)
- color
The color to paint the container with, if any.
- Type:
str | None
- border_style
The styling of the container’s border, if any.
- Type:
tessella.widgets.style.dropdown_style module
- class tessella.widgets.style.dropdown_style.DropdownStyle(background_color='#1E1D24', highlight_color='#2A2933', text_style=None, padding=None, border=None)[source]
Bases:
objectStyling object used to customize Dropdown widgets.
- Parameters:
background_color (str)
highlight_color (str)
text_style (TextStyle | None)
padding (EdgeInsets | None)
border (BorderStyle | None)
- background_color
The color of the dropdown’s box and of its entries, while not hovered.
- Type:
str
- highlight_color
The color of the dropdown’s box and of its entries, while hovered.
- Type:
str
- padding
The internal padding of the dropdown’s box and of its entries.
- Type:
- border
The styling of the dropdown’s box border.
- Type:
tessella.widgets.style.font_style module
- class tessella.widgets.style.font_style.FontStyle(bold=False, italic=False, strikethrough=False, underline=False)[source]
Bases:
objectStyling options for fonts.
- Parameters:
bold (bool)
italic (bool)
strikethrough (bool)
underline (bool)
- bold
Whether the related font should be render text as bold.
- Type:
bool
- italic
Whether the related font should be render text in italics.
- Type:
bool
- strikethrough
Whether the related font should render text with a strikethrough line.
- Type:
bool
- underline
Whether the related font should render text with an underline.
- Type:
bool
- Note that a font can have multiple styles applied to it at once.
tessella.widgets.style.palette module
- class tessella.widgets.style.palette.Palette[source]
Bases:
objectCentralized color constants for Tessella’s default theme.
Every *Style class in tessella.widgets.style sources its default colors from here, so the whole widget set stays visually consistent out of the box. To re-theme the library, edit the values on this class rather than the individual style classes.
- BACKGROUND
The application’s root background color.
- Type:
str
- SURFACE
The color of raised surfaces, such as cards, buttons and dropdown boxes.
- Type:
str
- SURFACE_VARIANT
A slightly different surface color, used for elements that need to stand out from a SURFACE, such as input-like boxes placed on top of cards.
- Type:
str
- ELEVATED
The color of a surface when hovered or highlighted, such as an active dropdown entry.
- Type:
str
- BORDER
The default color for borders and dividers.
- Type:
str
- TEXT_PRIMARY
The default color for text.
- Type:
str
- TEXT_SECONDARY
The color for less prominent, secondary text.
- Type:
str
- TEXT_MUTED
The color for the least prominent text, such as hints and captions.
- Type:
str
- ACCENT
The primary accent color, used to highlight interactive and active elements (buttons, active switches, checkboxes, radio buttons and sliders).
- Type:
str
- ACCENT_HOVER
A lighter variant of ACCENT, meant for hovered interactive elements.
- Type:
str
- CONTROL_INACTIVE
The color of an interactive control (switch/checkbox/radio track) while inactive.
- Type:
str
- CONTROL_THUMB
The color of the draggable/inner thumb of switches, checkboxes, radio buttons and sliders.
- Type:
str
- PLACEHOLDER
The color used by the Placeholder widget’s debug box, kept visually distinct from the rest of the palette so placeholders stand out from real content.
- Type:
str
tessella.widgets.style.radio_style module
- class tessella.widgets.style.radio_style.RadioStyle(thumb_color='#ECECF2', active_color='#686898', inactive_color='#3A3946', border_radius=None, thumb_padding=3)[source]
Bases:
objectStyling object used to customize Radio widgets.
- Parameters:
thumb_color (str)
active_color (str)
inactive_color (str)
border_radius (BorderRadius | None)
thumb_padding (int)
- thumb_color
The color of the inner thumb, shown when this radio button is the selected one in its group.
- Type:
str
- active_color
The color of the radio button’s box while it is being hovered.
- Type:
str
- inactive_color
The color of the radio button’s box while it is not being hovered.
- Type:
str
- border_radius
The rounding on the corners of the box and the inner thumb.
- Type:
- thumb_padding
The spacing between the box and the inner thumb, in pixels.
- Type:
int
tessella.widgets.style.slider_style module
- class tessella.widgets.style.slider_style.SliderStyle(background_color='#686898', thumb_color='#ECECF2')[source]
Bases:
objectStyling object used to customize Slider widgets.
- Parameters:
background_color (str)
thumb_color (str)
- background_color
The color of the slider’s track.
- Type:
str
- thumb_color
The color of the slider’s draggable thumb.
- Type:
str
tessella.widgets.style.switch_style module
- class tessella.widgets.style.switch_style.SwitchStyle(thumb_color='#ECECF2', active_color='#686898', inactive_color='#3A3946', border_radius=None, thumb_padding=2)[source]
Bases:
objectStyling object used to customize Switch widgets.
- Parameters:
thumb_color (str)
active_color (str)
inactive_color (str)
border_radius (BorderRadius | None)
thumb_padding (int)
- thumb_color
The color of the switch’s draggable thumb.
- Type:
str
- active_color
The color of the switch’s track while it is on or being hovered.
- Type:
str
- inactive_color
The color of the switch’s track while it is off and not being hovered.
- Type:
str
- border_radius
The rounding on the corners of the track and the thumb.
- Type:
- thumb_padding
The spacing between the track and the thumb, in pixels.
- Type:
int
tessella.widgets.style.text_style module
- class tessella.widgets.style.text_style.TextStyle(font_size=24, font_color='#F2F2F5', font_path='/home/docs/checkouts/readthedocs.org/user_builds/tessella/checkouts/latest/src/tessella/assets/code_new_roman.otf', anti_aliasing=True, font_style=None)[source]
Bases:
objectStyling for displayable texts.
- Parameters:
font_size (int)
font_color (str)
font_path (str | None)
anti_aliasing (bool)
font_style (FontStyle | None)
- font_size
The size of the font.
- Type:
int
- font_color
The color of the text.
- Type:
str
- font_path
Font file to be used. Defaults to DEFAULT_FONT_PATH (the bundled font).
- Type:
str | None
- anti_aliasing
Whether to use anti-aliasing when rendering the text or not.
- Type:
bool
- font
Font object created with the given parameters.
- Type:
pygame.font.Font
tessella.widgets.style.text_field_style module
- class tessella.widgets.style.text_field_style.TextFieldStyle(container_style=None, focused_border_color='#686898', text_style=None, hint_style=None, cursor_color='#F2F2F5', selection_color='#68689880', padding=None)[source]
Bases:
objectStyling object used to customize TextField widgets.
- Parameters:
container_style (ContainerStyle | None)
focused_border_color (str)
text_style (TextStyle | None)
hint_style (TextStyle | None)
cursor_color (str)
selection_color (str)
padding (EdgeInsets | None)
- container_style
The styling of the field’s box, including its background color and its border while unfocused.
- Type:
- focused_border_color
The color of the box’s border while the field is focused.
- Type:
str
- hint_style
The styling of the hint text, shown while the field is empty and unfocused.
- Type:
- cursor_color
The color of the blinking text cursor.
- Type:
str
- selection_color
The highlight color painted behind selected text.
- Type:
str
- padding
The internal padding around the text.
- Type: