euporie.core.style
Style related functions.
Functions
|
Create an application style based on the given color palette. |
|
Simple lightweight unbounded cache. |
Create a default Style object. |
|
|
Get Pygments style, caching the result. |
|
|
|
Return a style class by its short name. |
|
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 |
|
Create a 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 = '') 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) 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) 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) 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) 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) 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: ColorPaletteColor, amount: float) ColorPaletteColor
Interpolate between two colors.
- euporie.core.style.build_style(cp: ColorPalette, have_term_colors: bool = True) Style
Create an application style based on the given color palette.