Reputation: 77
Sorry if its a newbie question but entering new territory and google hasn't been very helpful and would love a fresh description Thank you
Upvotes: 4
Views: 7973
Reputation: 812
The way we represent colors is dependent on the system we try to use this color value. I do not know what language you're refering to in your question, but you can find #ffffff
used in CSS, while integer form 0xffffff
can be seen in different programming languages.
You may wonder why it is in HEX?
Just because it's easier to see the value of the color, as it's being presented in a way of 255 bytes for each color respectively. So, you can see that 0xff0000
is a pure red. Compare it to value of 16711680
- this is the same value but it does not tell you what color it is.
Every web/css developer can spot the pattern here*:
#ffffff, #cccccc, #aaaaaa, #999999, #666666, #333333, #000000
As it's just set colors from White to Black and some shades of gray in between.
Hope this helps!
*for CSS in particular, the above pattern should be written as:
#fff, #ccc, #aaa, #999, #666, #333, #000
Upvotes: 6