Source code for carbonkivy.theme.colors

from kivy.properties import ColorProperty
from kivy.utils import colormap, get_color_from_hex

from carbonkivy.theme.color_tokens import static_tokens


[docs] class ComponentColors:
[docs] button_primary = ColorProperty()
[docs] button_primary_hover = ColorProperty()
[docs] button_primary_active = ColorProperty()
[docs] button_secondary = ColorProperty()
[docs] button_secondary_hover = ColorProperty()
[docs] button_secondary_active = ColorProperty()
[docs] button_tertiary = ColorProperty()
[docs] button_tertiary_hover = ColorProperty()
[docs] button_tertiary_active = ColorProperty()
[docs] button_danger_primary = ColorProperty()
[docs] button_danger_secondary = ColorProperty()
[docs] button_dnager_hover = ColorProperty()
[docs] button_danger_active = ColorProperty()
[docs] button_separator = ColorProperty()
[docs] button_disabled = ColorProperty()
[docs] notification_background_error = ColorProperty()
[docs] notification_background_success = ColorProperty()
[docs] notification_background_info = ColorProperty()
[docs] notification_background_warning = ColorProperty()
[docs] notification_action_hover = ColorProperty()
[docs] notification_action_tertiary_inverse = ColorProperty()
[docs] notification_action_tertiary_inverse_active = ColorProperty()
[docs] notification_action_tertiary_inverse_hover = ColorProperty()
[docs] notification_action_tertiary_inverse_text = ColorProperty()
[docs] notification_action_tertiary_inverse_text_on_color_disabled = ColorProperty()
[docs] class ThematicColors(ComponentColors):
[docs] background = ColorProperty()
[docs] background_hover = ColorProperty()
[docs] background_active = ColorProperty()
[docs] background_selected = ColorProperty()
[docs] background_selected_hover = ColorProperty()
[docs] background_inverse = ColorProperty()
[docs] background_inverse_hover = ColorProperty()
[docs] background_brand = ColorProperty()
[docs] layer_01 = ColorProperty()
[docs] layer_02 = ColorProperty()
[docs] layer_03 = ColorProperty()
[docs] layer_hover_01 = ColorProperty()
[docs] layer_hover_02 = ColorProperty()
[docs] layer_hover_03 = ColorProperty()
[docs] layer_active_01 = ColorProperty()
[docs] layer_active_02 = ColorProperty()
[docs] layer_active_03 = ColorProperty()
[docs] layer_selected_01 = ColorProperty()
[docs] layer_selected_02 = ColorProperty()
[docs] layer_selected_03 = ColorProperty()
[docs] layer_selected_hover_01 = ColorProperty()
[docs] layer_selected_hover_02 = ColorProperty()
[docs] layer_selected_hover_03 = ColorProperty()
[docs] layer_selected_inverse = ColorProperty()
[docs] layer_selected_disabled = ColorProperty()
[docs] layer_accent_01 = ColorProperty()
[docs] layer_accent_02 = ColorProperty()
[docs] layer_accent_03 = ColorProperty()
[docs] layer_accent_hover_01 = ColorProperty()
[docs] layer_accent_hover_02 = ColorProperty()
[docs] layer_accent_hover_03 = ColorProperty()
[docs] layer_accent_active_01 = ColorProperty()
[docs] layer_accent_active_02 = ColorProperty()
[docs] layer_accent_active_03 = ColorProperty()
[docs] field_01 = ColorProperty()
[docs] field_02 = ColorProperty()
[docs] field_03 = ColorProperty()
[docs] field_hover_01 = ColorProperty()
[docs] field_hover_02 = ColorProperty()
[docs] field_hover_03 = ColorProperty()
[docs] border_interactive = ColorProperty()
[docs] border_subtle_00 = ColorProperty()
[docs] border_subtle_01 = ColorProperty()
[docs] border_subtle_02 = ColorProperty()
[docs] border_subtle_03 = ColorProperty()
[docs] border_subtle_selected_01 = ColorProperty()
[docs] border_subtle_selected_02 = ColorProperty()
[docs] border_subtle_selected_03 = ColorProperty()
[docs] border_strong_01 = ColorProperty()
[docs] border_strong_02 = ColorProperty()
[docs] border_strong_03 = ColorProperty()
[docs] border_tile_01 = ColorProperty()
[docs] border_tile_02 = ColorProperty()
[docs] border_tile_03 = ColorProperty()
[docs] border_inverse = ColorProperty()
[docs] border_disabled = ColorProperty()
[docs] text_primary = ColorProperty()
[docs] text_secondary = ColorProperty()
[docs] text_placeholder = ColorProperty()
[docs] text_on_color = ColorProperty()
[docs] text_on_color_disabled = ColorProperty()
[docs] text_helper = ColorProperty()
[docs] text_error = ColorProperty()
[docs] text_inverse = ColorProperty()
[docs] text_disabled = ColorProperty()
[docs] icon_primary = ColorProperty()
[docs] icon_secondary = ColorProperty()
[docs] icon_on_color = ColorProperty()
[docs] icon_on_color_disabled = ColorProperty()
[docs] icon_interactive = ColorProperty()
[docs] icon_inverse = ColorProperty()
[docs] icon_disabled = ColorProperty()
[docs] support_error = ColorProperty()
[docs] support_success = ColorProperty()
[docs] support_warning = ColorProperty()
[docs] support_info = ColorProperty()
[docs] support_error_inverse = ColorProperty()
[docs] support_success_inverse = ColorProperty()
[docs] support_warning_inverse = ColorProperty()
[docs] support_info_inverse = ColorProperty()
[docs] support_caution_minor = ColorProperty()
[docs] support_caution_major = ColorProperty()
[docs] support_caution_undefined = ColorProperty()
[docs] focus = ColorProperty()
[docs] focus_inset = ColorProperty()
[docs] focus_inverse = ColorProperty()
[docs] interactive = ColorProperty()
[docs] highlight = ColorProperty()
[docs] toggle_off = ColorProperty()
[docs] overlay = ColorProperty()
[docs] skeleton_element = ColorProperty()
[docs] skeleton_background = ColorProperty()
[docs] class StaticColors:
[docs] transparent = ColorProperty([1, 1, 1, 0])
def __init__(self) -> None: super().__init__() static_tokenmap = { token: get_color_from_hex(hex) for token, hex in static_tokens.items() } colormap.update(static_tokenmap) for token in static_tokenmap: setattr(self.__class__, token, colormap[token])