I think what are you used to. If you are used to HTML, you are likely to use HEX since it was just used in HTML. If you work against the background of design using Photoshop / Corel / PaintShopPro, etc., then you most likely use RGB notation, although at present many programs also contain a HEX value field.
As already mentioned, RGBA may be a reason to just go with the designation RGB - consistency.
Although, I think it also depends on the scenario. If you are comfortable with both, you can simply switch between them: #fff much easier to type than rgb(255,255,255) .
Another question is why people will say #fff instead of White (assuming most browsers support this keyword).
It all depends on preferences and readability - if you support a huge CSS file, being able to look at the color value and know what color it is, this is a really good advantage. It is even more beneficial to use something like LESS or Sass to add some kind of programmability to CSS - for example, constants. Therefore, instead of saying:
#title { color: #abcdef; }
Instead of LESS, you can do the following:
@base-color:
Maintaining CSS is becoming a problem.
If you are worried about browser rendering performance, then this may also be another factor for your choice.
So, it boils down to the following:
- Friendly
- Preference
- maintainability
- Performance
jamiebarrow Aug 26 '10 at 13:54 2010-08-26 13:54
source share