1

Chrome for Android allows devs to theme the UI with the meta-tag "metatheme". That sets the primary color and Chrome then automatically calculates a darker shade for the statusbar (primary dark color). See attached image for an example.

Now, Material Design generally says you should use a "500" color as a primary and a "700"-shade of that same color as the primary dark color. But since Chrome automatically calculates this value (and the 500/700 difference depends on the color) it doesn't completely match the Material colors and is difficult to predict without the formula Chrome uses.

So my question is: what formula does Chrome use to calculate the darker shade so I can predict it?

Related post: Meta themecolor in Chrome

enter image description here

REJH
  • 3,273
  • 5
  • 31
  • 56
  • 1
    Did you try this: https://stackoverflow.com/a/40964456/5846135 – Zeero0 Jan 22 '18 at 08:12
  • Nope, I haven't. Thanks, I'll give that a try with a couple of samples I've taken from Chrome with different themecolor values - and report back if that is what I'm looking for :) – REJH Jan 22 '18 at 09:15
  • It looks like getting the hsl value for the color and lowering it bij 12 doesn't do the trick entirely. It's close but some colors are really off. It looks like they bump up the saturation a little but I'm not sure yet. It's also possible that my rgb > hsl calculations are off but the results I'm getting seem accurate (i get the same values as i get in online convert tools). So maybe I need to find the actual code in chromium that handles the calculation..? – REJH Jan 23 '18 at 07:07

0 Answers0