Converting RGB values to HEX


Posted on 16th Feb 2014 07:03 pm by admin

Code: <?PHP

$file_handle = fopen("colors/rgb.csv", "r");

while (!feof($file_handle) ) {

$line_of_text = fgetcsv($file_handle, 1024);

print $line_of_text[2] . $line_of_text[3] . $line_of_text[4] . "<BR>";

}

fclose($file_handle);

?>
my code above currently outputs a list of RGB numbers for example:

Ref_RRef_GRef_B
149119109
190171158
200161148
154109111
1088888
1408579

I would like to now convert these numbers (each line) to HEX colors

please help?!

thanks

No comments posted yet

Your Answer:

Login to answer
75 Like 32 Dislike
Previous forums Next forums
Other forums

Problem with HTTP Caching...?
Hi there, im trying to implement caching. But it doesn't always work.
I post it here because ther

Using Curl_multi for processing multiple URLs
Hi,

I am at a loss as to how to implement this. I would like to be able to automatically assi

column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam

PHP & MS Access - Line Break
Hey Guys!

I'm pulling records from an MS Access database and listing them using PHP and I'm r

what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

captcha error
I have been trying to implement a captcha in php...

here is the code..
Code: (php) [Select

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

mysql UPDATE request not working and driving me crazy!!!
Hi,

I have been stuck on this for ages.

Quite simply I am trying to update my database

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash