Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce color module #2614

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Introduce color module #2614

wants to merge 2 commits into from

Conversation

falkoschindler
Copy link
Contributor

@falkoschindler falkoschindler commented Feb 25, 2024

This PR is an alternative, simplified implementation of PR #2537. It introduces a color module and allows to use color constants like this:

from nicegui import color, ui

ui.icon('home', color=color.RED)
ui.icon('home', color=color.quasar.RED_5)
ui.icon('home', color=color.tailwind.RED_500)

Open tasks:

  • pytest
  • documentation
  • color.RED can result in Quasar color
  • uppercase/lowercase?

@falkoschindler falkoschindler added the enhancement New feature or request label Feb 25, 2024
@falkoschindler falkoschindler marked this pull request as draft February 25, 2024 16:56
@falkoschindler falkoschindler added this to the 1.4.16 milestone Feb 26, 2024
@falkoschindler
Copy link
Contributor Author

I just noticed that

ui.icon('home', color=color.RED)

results in a Quasar color, because Quasar's "red" has the same name. We could avoid that by translating to the hex value:

RED = '#ff0000'

@falkoschindler falkoschindler removed this from the 1.4.16 milestone Feb 26, 2024
@falkoschindler falkoschindler added this to the 2.0.0 milestone Apr 8, 2024
@falkoschindler falkoschindler modified the milestones: 2.0.0, 2.x Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants