4
I am working on an app where I am trying to follow Google’s Material design guide. On this page, it is recommended to use the black color (#000000
) with 87% opacity as the color of the main texts.
Using a decimal to hexadecimal converter, I have reached the value of 57 in the Hex base. Uniting the desired opacity with the color, I arrived that the final color should be #57000000
, but the result was this:
While it should look like this:
My question is: was there a miscalculation on my part? Isn’t this how opacity should be calculated? The opacity value ranges from 0-100 or 0-255?
My color xml 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>
Thanks for the quick reply! By the visa was just a miscalculation of mine. I didn’t think about the possibility of the interval being 255 values, instead of 100 as I had considered.
– Renan Lazarotto
@Renanlazarotto added the table of transparency values you mentioned in the statement.
– Bacco
Thanks again! I will save this list for future reference.
– Renan Lazarotto