Skip to main content
edited body; edited title
Source Link
Luke Girvin
  • 13.4k
  • 10
  • 65
  • 85

RGB to Hexhex and Hexhex to RGB

How to convert colors in RGB format to Hexhex format and vice versa?

For example, convert '#0080C0' to (0, 128, 192).

RGB to Hex and Hex to RGB

How to convert colors in RGB format to Hex format and vice versa?

For example, convert '#0080C0' to (0, 128, 192).

RGB to hex and hex to RGB

How to convert colors in RGB format to hex format and vice versa?

For example, convert '#0080C0' to (0, 128, 192).

Notice removed Reward existing answer by Dogbert
Bounty Ended with Ron Gilchrist's answer chosen by Dogbert
Notice added Reward existing answer by Dogbert
Bounty Started worth 100 reputation by Dogbert
deleted 1 character in body
Source Link
Michał Perłakowski
  • 91.4k
  • 29
  • 163
  • 184

Well, I just needHow to convert colors in RGB valuesformat to HEXHex format and the other way around.vice versa?

I've tried thisFor example, but it didn't work.

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

Exampleconvert :'#0080C0' to (0, 128, 192).

#0080C0 to (0,128,192)

Well, I just need to convert RGB values to HEX and the other way around.

I've tried this, but it didn't work.

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

Example :

#0080C0 to (0,128,192)

How to convert colors in RGB format to Hex format and vice versa?

For example, convert '#0080C0' to (0, 128, 192).

Question Protected by Matt
added 8 characters in body
Source Link
Bram Vanroy
  • 28k
  • 26
  • 142
  • 258

Well, iI just need to make these convertion by using javascriptconvert RGB values to HEX and the other way around.

I've trytried this, but it didn't works..work.

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

Example :

#0080C0 to (0,128,192)

Well, i just need to make these convertion by using javascript.

I've try this, but it didn't works...

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

Example :

#0080C0 to (0,128,192)

Well, I just need to convert RGB values to HEX and the other way around.

I've tried this, but it didn't work.

function RGB2HTML(red, green, blue)
{
    var decColor = red + 256 * green + 65536 * blue;
    return decColor.toString(16);
}

Example :

#0080C0 to (0,128,192)
edited tags
Link
Bram Vanroy
  • 28k
  • 26
  • 142
  • 258
Loading
edited title; added 43 characters in body
Source Link
Sindar
  • 10.7k
  • 6
  • 33
  • 44
Loading
edited tags
Link
BoltClock
  • 716.5k
  • 164
  • 1.4k
  • 1.4k
Loading
Source Link
Sindar
  • 10.7k
  • 6
  • 33
  • 44
Loading