euporie.core.style
Style related functions.
Functions
|
Create an application style based on the given color palette. |
Create a default Style object. |
|
|
|
|
Classes
Define a collection of colors. |
|
|
A representation of a color with adjustment methods. |
|
Very simple cache that discards the oldest item when the cache size is exceeded. |
|
Create a |
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. |
- class euporie.core.style.ColorPalette
Bases:
object
Define a collection of colors.
- add_color(name: str, base: str, _base_override: str = '') euporie.core.style.ColorPalette
Add a color to the palette.
- class euporie.core.style.ColorPaletteColor(base: str, _base_override: str = '')
Bases:
object
A representation of a color with adjustment methods.
- adjust(hue: float = 0.0, brightness: float = 0.0, saturation: float = 0.0, rel: bool = True) euporie.core.style.ColorPaletteColor
Adjust the hue, saturation, or brightness of the color.
- Parameters
hue – The hue adjustment.
brightness – The brightness adjustment.
saturation – The saturation adjustment.
rel – If True, perform a relative adjustment.
- Returns
The adjusted color.
- Return type
- darker(amount: float, rel: bool = True) euporie.core.style.ColorPaletteColor
Make the color darker.
- Parameters
amount – The amount to darken the color by.
rel – If True, perform a relative adjustment.
- Returns
The darker color.
- Return type
- less(amount: float, rel: bool = True) euporie.core.style.ColorPaletteColor
Make bright colors brighter and dark colors darker.
- Parameters
amount – The amount to adjust the color by.
rel – If True, perform a relative adjustment.
- Returns
The adjusted color.
- Return type
- lighter(amount: float, rel: bool = True) euporie.core.style.ColorPaletteColor
Make the color lighter.
- Parameters
amount – The amount to lighten the color by.
rel – If True, perform a relative adjustment.
- Returns
The lighter color.
- Return type
- more(amount: float, rel: bool = True) euporie.core.style.ColorPaletteColor
Make bright colors darker and dark colors brighter.
- Parameters
amount – The amount to adjust the color by.
rel – If True, perform a relative adjustment.
- Returns
The adjusted color.
- Return type
- towards(other: euporie.core.style.ColorPaletteColor, amount: float) euporie.core.style.ColorPaletteColor
Interpolate between two colors.
- euporie.core.style.build_style(cp: euporie.core.style.ColorPalette, have_term_colors: bool = True) prompt_toolkit.styles.style.Style
Create an application style based on the given color palette.