2

Is there any advantage in using one against the other. Material design guidelines have used Alpha values to signify contrast for fonts. I could not really find a reason for doing so(as compared to using absolute colour values).

2 Answers 2

4

When using an alpha value, the color you see depends on the color in the layer below the color with alpha value.

See the example below.

When using a black (#000000) with 50 alpha on a white background you will get the 'actual color code' #7F7F7F, but when you but a blue color behind it, it will influence the actual color code of the #000000 with 50 alpha. In that case it is #277160.

Developers (the ones I've worked with) prefer actual color codes because of this.

enter image description here

2

The Material design guidelines use opacity for readability and accessibility reasons. The example they use on https://material.io/guidelines/style/color.html#color-usability demonstrates the issue:

Using opacity instead of shifting colors often creates better contrast and relative luminance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.