Ios: Status bar doesn鈥檛 match theme if rgb() values are used instead of hex values

Created on 30 Jun 2019  路  8Comments  路  Source: home-assistant/iOS

Hi,

When changing themes, the status bar change to a white-ish color and I can't seem to change it. Any advise would be appreciated :)

IMG_5C9EF76F34FC-1

2020.2 bug frontend

Most helpful comment

Hi,

I figured it out.
Indeed, i altered the midnight theme, the reason it did not work, I used rgb(x,y,z) instead of #aabbcc. The app doesn't seem to understand this, so chaning back to #something everything is working again.

Cheers, and thanks for the help!

All 8 comments

Hi Vandalon,

You need to use frontend.set_theme have a look at the instructions here. I鈥檓 going to close this for now. If that doesn鈥檛 work just post back on this issue and I鈥檒l re open.

This is what I do :)

This is after execution:

IMG_F93F360C5A51-1

First I would recommend pulling down to refresh after setting the theme. In some very rare cases it doesn't update everything in real-time until you refresh first. You could also try force quitting the app after setting the theme to force it to update.

The iOS app status bar is themed using the primary-color value of your Home Assistant theme. From the screenshot you've posted, it does not appear to be the correct color values for Midnight. Is it a customized version? Can you copy and paste the primary-color line from it? For example:

midnight:
  # Main colors
  primary-color: '#5294E2'

The other thing that might possibly be interfering, it appears that you're using Compact Custom Header to minimize the height of the status bar. If none of the above things work, you could try temporarily disabling Compact Custom Header to see if that was causing the issue.

Hi,

I figured it out.
Indeed, i altered the midnight theme, the reason it did not work, I used rgb(x,y,z) instead of #aabbcc. The app doesn't seem to understand this, so chaning back to #something everything is working again.

Cheers, and thanks for the help!

Thanks for working that out. I think I鈥檇 call that a bug to be honest. So let鈥檚 leave this here for now. Cheers again

Just a note that this is still true in 2020.2

There exist a huge number of variations that need to be parsed:

  • rgb with integer (0-255) values
  • rgb with percentile (0-100%) values
  • rgba with integer (0-255) values
  • rgba with percentile (0-100%) values
  • hsl
  • hsla
  • color with transforms of the colors which is coming up in CSS

Ideally, now that we pull the color from the style in JavaScript, we could use some kind of built-in mechanism that's able to canonicalize the color. But鈥t really doesn't seem like there is one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mynameisdaniel32 picture mynameisdaniel32  路  9Comments

wilfredsmit picture wilfredsmit  路  5Comments

TacoRocket picture TacoRocket  路  8Comments

jjpeet picture jjpeet  路  15Comments

vmcosco picture vmcosco  路  8Comments