MohammadAG / Xposed-Tinted-Status-Bar

Android Tinted Status Bars using Xposed
102 stars 53 forks source link

TSB using HSB color gamut rather than ARGB? #20

Open claytonjn opened 10 years ago

claytonjn commented 10 years ago

There's some strange behavior with picking colors. It appears that although the color picker is ARGB, the colors available are not the full RGB gamut. Basically, one cannot choose any hex code.

For example, if I chose FFFEFEFE or FFFDFDFD it changes to FFFFFFFF. If I choose FFFCFCFC however, it sticks. What is looks like is that it's following HSB (Hue, Saturation, Brightness) values rather than ARGB values. For example, in Photoshop, if I have HSB 0,0,100 it represents pure white with RGB values 255,255,255 and Hex code FFFFFF. If I change HSB to 0,0,99 the RGB value jump down to 252,252,252 and Hex code FCFCFC (which is what the color picker in Tinted Status Bar jumps to) if I chose HSB values of 0,0,98 then the hex code is FAFAFA which is the next color that can be entered in Tinted Status Bar (entering FBFBFB manually changes it to FCFCFC). I think this is too much of a correlation to be coincidental.

Also, for the alpha channel, Tinted Status Bar jumps from FF to FA, but then it seems it can successfully decrements by one, but it jumps from 00 to 05 before it can be incremented by 1. So basically on the 0-255 scale the user can choose 0,5-250,255.

Is this something you can look into? When trying to match colors so that they blend perfectly even being off by just a few numbers can make a visible differentiation.

MohammadAG commented 10 years ago

It's a limitation of the colour picker used, when clicking preview, it estimates what i can show and shows it.

You can get around this by typing the colour and clicking apply without tapping preview, and the colour will be saved as typed. Opening the activity again might cause it to change though.

Unless there's a drop in replacement for the colour picker that doesn't do this, this'll have to stay as a bug :/

claytonjn commented 10 years ago

Best one I found was this: https://github.com/attenzione/android-ColorPickerPreference however it would need to be modified slightly to allow typing in the hex code, which is obviously the most important feature for this module. Both XuiMod and Gravitybox use a color picker very similar to that one, but with the added hex option. Actually, a quick browse through Gravitybox source shows that's the exact color picker used, but modified. Perhaps you could borrow it from here: https://github.com/GravityBox/GravityBox/tree/kitkat/src/net/margaritov/preference/colorpicker

The only other reasonably functional color picker I found was this: https://code.google.com/p/devmil-android-color-picker/ which is feature-rich but has very outdated styling and doesn't exactly fit in with newer Android design.