You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1HTML Basics - HEX and RGB colors Empty HTML Basics - HEX and RGB colors Tue Nov 15, 2011 7:18 am

Gassy

Gassy
Below are a table with basically 9, the most important colors. You must learn these codes, and all description which are here:

HEX Color
RGB Color
Background color (Preview)
Color name
#FFFFFF
(255,255,255)
white
#000000
(0,0,0)
black
#FF0000
(255,0,0)
red
#00FF00
(0,255,0)
green
#0000FF
(0,0,255)
blue
#FFFF00
(255,255,0)
yellow
#FF00FF
(255,0,255)
fuchsia
#00FFFF
(0,255,255)
cyan
#C0C0C0
(192,192,192)
silver

Well...
- The definiton of RGB is simple => RedGreenBlue;

- Also, HEX is named hexadecimal;

- Note, that HEX color is similar to RGB in the point of view that RGB are the same as HEX, but only the structure is not that; tongue

- (255,0,255) => #FF00FF, so... 255(red) have a maximum value, 0(green) don't have a value, or the value is minimal, and the third 255(blue) value is maximum too. Please note, that 255=FF / 0=00 / 255=FF.

More colored examples to be more easy to learn:
rgb(255,0,192) = #FF00C0;
rgb(55,192,255) = #37C0FF;
rgb(100,150,200) = #6496C8;
rgb(192,255,192) = #C0FFC0;
rgb(192,0,50) = #C00032.

- The biggest value is rgb (255) or HEX #FF / #F, and the smallest rgb (0) or HEX #00 / #0;

- The HEX's value can be abbreviated. So, you can change #0088FF into #08F. How this works? Very simple: 0, 8 and F doubles. Attention: the result is the same;

- So RGB, as HEX colors, have more than 16 million different colors according the W3Schools. A simple calculation: (256x256x256), why 256 and not 255? Logical, 0 is the first value, and 255 the last.
0 = 1;
1 = 2;
2 = 3;
3 = 4;
.....;
254 = 255;
255 = 256;


HTML Code example & description:
Code:
Here are a little example:<br/ >
<font color="#FF0000">Hello {USERNAME}</font>
The same color, but simply another text:

<font color="#F00">How are you {USERNAME}</font>
As you can see, the color is the same (#FF0000 / #F00);
The font tag is used to grant ter the color attribute+value: color="#F00";
Also, you can use in CSS Stylesheet these codes to providing a color:
Code:
.class1{
color: #0088FF;
}
and the HTML code:
Code:
<span class="class1">Hello {USERNAME} at Gassy</span>
I don't want to complicate you, for CSS lessons after some time... Wink

Written by Gassy!
Please note that this tutorial is copyrighted & created only for CodePhase.
If you post this tutorial on your forum without permission of the administrator the risk of your forum been shut down, is high!
Thanks for the editing the message



Last edited by Gassy on Sat Nov 19, 2011 10:44 pm; edited 2 times in total

2HTML Basics - HEX and RGB colors Empty Re: HTML Basics - HEX and RGB colors Sat Nov 19, 2011 5:19 am

RockerMan

RockerMan
Administrator
Your proposal has been accepted, congratulations!

https://code-phase.forumotion.co.uk

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

 

Forumotion's free forums | ©phpBB | Free forum support | Report an abuse | Forumotion.com