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

Create extended colorstop/colorlist type for enhanced styling #48

Open
AmoebeLabs opened this issue Dec 31, 2020 · 1 comment
Open

Create extended colorstop/colorlist type for enhanced styling #48

AmoebeLabs opened this issue Dec 31, 2020 · 1 comment
Labels
enhancement New feature or request styling Style / Classes stuff theming About themes support tool/base Base part for all tools

Comments

@AmoebeLabs
Copy link
Owner

AmoebeLabs commented Dec 31, 2020

The Problem To Be Solved

SAK uses a very compact colorstop/colorlist definition. That definition is inherited from the Flexible Horse Shoe custom card.

Other cards use a more verbose implementation.

The SAK implementation (coming from FH):

  colorstops:
    fill: true
    colors:
      0: '#A8E05F'
      51: '#FDD74B'
      101: '#FE9B57'
      151: '#FE6A69'
      201: '#A97ABC'
      301: '#A87383'

This is very compact and easy to understand!

Additional background:

The initial idea was to change this definition, but that is a big breaking change and requires changing all the existing views and examples.

Additionally: it hinders the quick release of the public release candidate.

(Optional): Suggested Solution

So, the suggested solution is one that is listed below and used for the lines tool (see issue #55 ), but instead of changing the current colorstop and colorlist types, these extended definitions are implemented in the colorstopex and colorlistex types!

Meaning:

  • Not a breaking change
  • Implementation can be postponed after the release candidate.
  • Me happy!
@AmoebeLabs AmoebeLabs added refactoring Code refactoring issues tool/base Base part for all tools labels Dec 31, 2020
@AmoebeLabs AmoebeLabs added this to the Public release milestone Dec 31, 2020
@AmoebeLabs
Copy link
Owner Author

AmoebeLabs commented Dec 24, 2021

Or make it, just as commented on the lines tool (#55) in line with the styles/classes structure, and thus with the animations section:

  colorstop:
    colors:
      - value: 0                 # The stop
        styles:                 # Styles / Classes
          any:                  # Any part
            fill: '#A8E05F'
            stroke: '#A8E05E'
      - stop: 51
        classes:
          any:
            myClass: true       #'#FDD74B'
      - stop: 101
        styles:
          any:
            fill: '#FE9B57'
      - stop: 151
        styles:
          Any:
            fill: '#FE6A69'
      - stop: 201
        styles:
          any:
            fill: '#A97ABC'
      - stop: 301
        styles:
          any:
            fill: '#A87383'

The question then arises if one should use animations or colorstops:

  • if only used as colorstop, an animation can do exactly the same
  • a colorstop however can also use gradients, or use the lastcolor to fill the colorstop
  • an segarc and more tools use the colorstop to create the segments

So: other usage. They should coexist !

Note:
As the colorstop now contains the part name, it cannot be used as generic colorstop anymore, ie as template. Therefor the any part is introduced. Any will work for a circle, rectex, text, segarc, etc. just for specific stuff like lines parts, a specific colorstop is required, if each part must have different colors…

AmoebeLabs added a commit that referenced this issue Dec 28, 2021
- Changes to slider (see #45)
- Icon updates. Rendering using animations instead of custom timer to wait for icon loading...
- Experiments for new colorstop format, see (#48 and #55 for extra info)
@AmoebeLabs AmoebeLabs modified the milestones: Public release (v1.0.0), Release Candidate (v0.9.x) Mar 7, 2022
@AmoebeLabs AmoebeLabs added the breaking change Breaking configuration or functional change label Jun 5, 2022
@AmoebeLabs AmoebeLabs changed the title Align colorstop config with hass and other custom cards Create extended colorstop/colorlist type for enhanced styling Jun 5, 2022
@AmoebeLabs AmoebeLabs added enhancement New feature or request theming About themes support styling Style / Classes stuff and removed refactoring Code refactoring issues breaking change Breaking configuration or functional change labels Jun 5, 2022
@AmoebeLabs AmoebeLabs removed this from the Release Candidate (v0.9.x) milestone Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request styling Style / Classes stuff theming About themes support tool/base Base part for all tools
Projects
None yet
Development

No branches or pull requests

1 participant