1

Color specified as

<font fgcolor="#ffff0000">red</font>

works, while

<font fgcolor="#0000FF">blue</font>

does not work.

How fix this problem?

5
  • ... try <font fgcolor="#ff0000ff">blue</font> Commented Dec 13, 2014 at 11:57
  • work, thank you! And how to make the green color? Commented Dec 13, 2014 at 12:03
  • see my answer and read documentation about how colors are defined too Commented Dec 13, 2014 at 12:04
  • Marcin Orlowski, thank you! Commented Dec 13, 2014 at 12:05
  • ... try <font fgcolor="#ff00ff00">green</font> The rule is: <font fgcolor="#aarrggbb">color</font>. The meaning of the Alpha component is well explained in @MarcinOrlowski's answer. Commented Dec 13, 2014 at 12:33

1 Answer 1

3

On Android color is defined as ARGB where A stands for alpha channel (transparency). For alpha, value of 00 means fully transparent, and FF means fully opaque. So when you define your color as RGB, ommiting A part, then A is being considered as set to 00 which in result makes your color fully transparent, thus your color is invisible and may look like not working. This behaviour sometimes can differ and lack of of A can be interpreted as opaque, but this is rather exception so it's safer to always specify alpha value. BTW: color cannot work anyway :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.