euporie.core.style

Style related functions.

Functions

base_styles(cp)

Generate base application styles.

buffer_styles(cp)

Generate buffer and editor styles.

build_style(cp[, have_term_colors])

Create an application style based on the given color palette.

cache(user_function, /)

Simple lightweight unbounded cache.

cell_styles(cp)

Generate notebook cell styles.

chrome_styles(cp)

Generate chrome and UI element styles.

completion_styles(cp)

Generate completion menu styles.

dataframe_styles(cp)

Generate dataframe display styles.

default_ui_style()

Create a default Style object.

dialog_styles(cp)

Generate dialog styles.

get_style_by_name(name)

Get Pygments style, caching the result.

hls_to_rgb(h, l, s)

input_widget_styles(cp, style_variants)

Generate input widget styles.

ipywidget_styles(cp, style_variants)

Generate ipywidget styles.

markdown_styles(cp)

Generate markdown rendering styles.

menu_styles(cp)

Generate menu and menu bar styles.

pager_styles(cp)

Generate pager styles.

palette_styles(cp)

Generate command palette styles.

pyg_get_style_by_name(name)

Return a style class by its short name.

rgb_to_hls(r, g, b)

scrollbar_styles(cp)

Generate scrollbar styles.

shadow_styles(cp)

Generate drop shadow styles.

shortcuts_styles(cp)

Generate shortcuts display styles.

sidebar_styles(cp)

Generate sidebar styles.

statusbar_styles(cp)

Generate statusbar styles.

tab_bar_styles(cp)

Generate tab bar styles.

tabbed_split_styles(cp)

Generate tabbed split container styles.

toolbar_styles(cp)

Generate toolbar styles.

Classes

ColorPalette()

Define a collection of colors.

ColorPaletteColor(base[, _base_override])

A representation of a color with adjustment methods.

SimpleCache([maxsize])

Very simple cache that discards the oldest item when the cache size is exceeded.

Style(style_rules)

Create a Style instance from a list of style rules.

partial(func, /, *args, **keywords)

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.

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.

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.

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.

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.

towards(other: ColorPaletteColor, amount: float) ColorPaletteColor

Interpolate between two colors.

euporie.core.style.base_styles(cp: ColorPalette) dict[str, str]

Generate base application styles.

euporie.core.style.buffer_styles(cp: ColorPalette) dict[str, str]

Generate buffer and editor styles.

euporie.core.style.build_style(cp: ColorPalette, have_term_colors: bool = True) Style

Create an application style based on the given color palette.

euporie.core.style.cell_styles(cp: ColorPalette) dict[str, str]

Generate notebook cell styles.

euporie.core.style.chrome_styles(cp: ColorPalette) dict[str, str]

Generate chrome and UI element styles.

euporie.core.style.completion_styles(cp: ColorPalette) dict[str, str]

Generate completion menu styles.

euporie.core.style.dataframe_styles(cp: ColorPalette) dict[str, str]

Generate dataframe display styles.

euporie.core.style.dialog_styles(cp: ColorPalette) dict[str, str]

Generate dialog styles.

euporie.core.style.get_style_by_name(name: str) type[PygmentsStyle]

Get Pygments style, caching the result.

euporie.core.style.input_widget_styles(cp: ColorPalette, style_variants: dict[str, ColorPaletteColor]) dict[str, str]

Generate input widget styles.

euporie.core.style.ipywidget_styles(cp: ColorPalette, style_variants: dict[str, ColorPaletteColor]) dict[str, str]

Generate ipywidget styles.

euporie.core.style.markdown_styles(cp: ColorPalette) dict[str, str]

Generate markdown rendering styles.

euporie.core.style.menu_styles(cp: ColorPalette) dict[str, str]

Generate menu and menu bar styles.

euporie.core.style.pager_styles(cp: ColorPalette) dict[str, str]

Generate pager styles.

euporie.core.style.palette_styles(cp: ColorPalette) dict[str, str]

Generate command palette styles.

euporie.core.style.scrollbar_styles(cp: ColorPalette) dict[str, str]

Generate scrollbar styles.

euporie.core.style.shadow_styles(cp: ColorPalette) dict[str, str]

Generate drop shadow styles.

euporie.core.style.shortcuts_styles(cp: ColorPalette) dict[str, str]

Generate shortcuts display styles.

euporie.core.style.sidebar_styles(cp: ColorPalette) dict[str, str]

Generate sidebar styles.

euporie.core.style.statusbar_styles(cp: ColorPalette) dict[str, str]

Generate statusbar styles.

euporie.core.style.tab_bar_styles(cp: ColorPalette) dict[str, str]

Generate tab bar styles.

euporie.core.style.tabbed_split_styles(cp: ColorPalette) dict[str, str]

Generate tabbed split container styles.

euporie.core.style.toolbar_styles(cp: ColorPalette) dict[str, str]

Generate toolbar styles.