I'm working on an application where I'm trying to follow the Google Material design guide. On this page, it is recommended to use black color (% color) with 87% opacity as the color of the main texts.
Using a hexadecimal to decimal converter, I reached the value of 57 in the hex base. Joining the desired opacity with the color, I arrived that the final color should be #000000
, but the result was this:
Whileitshouldlooklikethis:
My question is: was there a miscalculation on my part? Is not this how the opacity should be calculated? Does the opacity value vary from 0-100 or 0-255?
My xml color file is this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- cores do android L -->
<color name="texto">#57000000</color>
<color name="texto_secundario">#36000000</color>
<color name="dica">#1A000000</color>
<color name="divisores">#0C000000</color>
<color name="laranja">#ffab40</color>
<color name="laranja_escuro">#ff9100</color>
<color name="laranja_claro">#ffd180</color>
<color name="roxo">#673ab7</color>
<color name="roxo_escuro">#512da8</color>
<color name="roxo_claro">#d1c4e9</color>
</resources>