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

add support for parsing theme color #61

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hellkun
Copy link

@hellkun hellkun commented Mar 10, 2021

Hi there, thanks you making this great package.

In my experience, it's rather difficult to make the color of texts suitable for both light and dark theme. For example, texts of deep grey look good on light theme, but hardly readable on dark theme.
Maybe we could support apply colors defined in colorScheme, e.g. primary, onPrimary, surface, onSurface, etc, to keep the same level of readability regradless of which theme is applied.

This PR might have a workaround for use cases like above, which defines a mapping for themed color, like:

  • ::primary -> colorScheme.primary
  • ::onPrimary -> colorScheme.onPrimary
  • ::surface -> colorScheme.surface
  • ::onSurface -> colorScheme.onSurface
    ...

There's also limitation: The exported json has to be manually modified, as the code has not idea about the developer's intention (a constant hex color, or a color picked from colorScheme)

@yashmittalJTG
Copy link

Missing concrete implementations of 'WidgetParser.export' and 'getter WidgetParser.widgetType'.
any solution for this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants