I wonder if there is something that has been encountered before:
I have a 2dp progress bar with a grey background that should be colour #666666 and a progress colour of red #ff0000 (given by designer from photoshop). The issue I encountered is: the grey colour given is way lighter on android screen than the actual #666666 colour. This was tested on different android screens so it doesn't seem to be on one display. The background is opaque so it's not getting colours from behind the progress bar, and it also seem to be happening just with the grey as the red colour displays correctly.
My question is: Is there a known issue with xml colours? Maybe due to size? Any format that I didn't take into consideration? (I'm quite new to android).
The way I went around it was by tweaking the colour code to be as dark as the #666666 colour looks in photoshop so it ended up being code #333333 (just so it's representative to what the designer wanted). This is a good enough fix for now but am worried that the assets and colour codes given by designer won't be actually useful if it happens again.
I'm working with Android sdk 19, 4.4.2. Colours codes are taken from /values/colors.xml.
The following is an example of the progress bar drawable:
<layer-list xmlns:android="http://ift.tt/nIICcg">
<item android:id="@android:id/background">
<shape>
<size android:height="2dp" />
<gradient
android:centerColor="@color/grey_progressBar_background"
android:endColor="@color/grey_progressBar_background"
android:startColor="@color/grey_progressBar_background"
/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<size android:height="2dp" />
<gradient
android:endColor="@color/red"
android:startColor="@color/red" />
</shape>
</clip>
</item>
</layer-list>
No comments:
Post a Comment