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

Icon (ok) and segmented arc (nok) not showing the same color at exact colorstop limits #191

Open
1 task done
AmoebeLabs opened this issue May 1, 2023 · 0 comments
Open
1 task done
Labels
bug/confirmed Confirmed bug bug Something isn't working tool/segmented-arc About the segmented arc tool

Comments

@AmoebeLabs
Copy link
Owner

AmoebeLabs commented May 1, 2023

Bug report notice

Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!

So make sure your problem is not related to that!

  • Yes, I'm sure that it is not a configuration mistake

Bug description

A clear and concise description of what the bug is.

The colorstop limits are nog always consistent between segmented arc and animations.
The segmented arc stays green when percentage changes to 40% (why??), but after a browser refresh it becomes yellow. The battery percentage icon however stays green at 40%.

Both are using the same colorstop template. So this seems some calculation is going wrong to determine the current color in the segarc rendering after a refresh. Might be something about > or >= or < and <=.

Battery percentage at 40%:
image

And battery percentage at 39%:
image

image

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

YAML definition of view part:

          layout:
            template:
              name: sak_layout_fce_sensor2
              variables:
                - sak_layout_sensor_colorstops_template: colorstops_battery_level
                - sak_layout_sensor_icon_style: colorstops
                - sak_layout_sensor_segarc_style: colorstops
                - sak_layout_sensor_scale_max: 100    

The colorstops_battery_level template looks like this:

colorstops_battery_level:
  template:
    type: colorstops
    defaults:
      - thegap: 1
      - theFill: true
      - theStroke: false
  colorstops:
    gap: '[[thegap]]'
    fill: '[[theFill]]'
    stroke: '[[theStroke]]'
    colors:
      00: 'var(--brand-google-red)'
      20: 'var(--brand-google-yellow)'
      40: 'var(--brand-google-green)'

Expected behavior

A clear and concise description of what you expected to happen.

Both the icon as the segarc are using the same (of course) colorstop template, so should show the same colors. Even after a refresh!

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop browser (please complete the following information):

  • OS: [e.g. Windows]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 110]

Companion App on Smartphone/Tablet (please complete the following information):

  • Device: [e.g. iPhone16]
  • OS: [e.g. iOS16]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 16]

Additional context
Add any other context about the problem here.

(Optional): Suggested Solution

Any suggested solution to this bug.

@AmoebeLabs AmoebeLabs added bug Something isn't working tool/segmented-arc About the segmented arc tool labels May 1, 2023
@AmoebeLabs AmoebeLabs added this to the Release v2.x.y milestone May 1, 2023
@AmoebeLabs AmoebeLabs added the bug/confirmed Confirmed bug label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed Confirmed bug bug Something isn't working tool/segmented-arc About the segmented arc tool
Projects
None yet
Development

No branches or pull requests

1 participant