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

Login Issue's
Code: <?php
$file = fopen('user.txt', 'r');

/* Set login to false initially */

SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here i

Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe

Posting Serialized Data Not Working
I am trying to send an object from one PHP file to another using POST. I serialize the object and th

login to other site by sending post variables
hey,

here is my problem: my school gave me a mail account for school-stuff use. they mail us

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

Creating a db with a query
Hello everyone.
I'm having troubles creating a db with a query.
I'm reading a book called PHP

Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn

set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

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