colors.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. from .custom_view import CustomView
  2. from .element import Element
  3. CustomView.use(__file__)
  4. class ColorsView(CustomView):
  5. def __init__(self, primary, secondary, accent, positive, negative, info, warning):
  6. super().__init__('colors',
  7. primary=primary,
  8. secondary=secondary,
  9. accent=accent,
  10. positive=positive,
  11. negative=negative,
  12. info=info,
  13. warning=warning)
  14. self.initialize(temp=False)
  15. class Colors(Element):
  16. def __init__(self, *,
  17. primary='#1976d2',
  18. secondary='#26a69a',
  19. accent='#9c27b0',
  20. positive='#21ba45',
  21. negative='#c10015',
  22. info='#31ccec',
  23. warning='#f2c037'):
  24. """Color Theming
  25. Sets the main colors (primary, secondary, accent, ...) used by [Quasar](https://quasar.dev/).
  26. """
  27. super().__init__(ColorsView(primary, secondary, accent, positive, negative, info, warning))