colors.py 996 B

12345678910111213141516171819202122232425262728293031
  1. from ..dependencies import register_component
  2. from ..element import Element
  3. register_component('colors', __file__, 'colors.js')
  4. class Colors(Element):
  5. def __init__(self, *,
  6. primary='#5898d4',
  7. secondary='#26a69a',
  8. accent='#9c27b0',
  9. dark='#1d1d1d',
  10. positive='#21ba45',
  11. negative='#c10015',
  12. info='#31ccec',
  13. warning='#f2c037') -> None:
  14. """Color Theming
  15. Sets the main colors (primary, secondary, accent, ...) used by `Quasar <https://quasar.dev/>`_.
  16. """
  17. super().__init__('colors')
  18. self._props['primary'] = primary
  19. self._props['secondary'] = secondary
  20. self._props['accent'] = accent
  21. self._props['dark'] = dark
  22. self._props['positive'] = positive
  23. self._props['negative'] = negative
  24. self._props['info'] = info
  25. self._props['warning'] = warning
  26. self.update()