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

breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:

abc

My query is being run with no results.
I have this.

Code: function DropUser($duser_id, $user_email, $user_username) {

function to return url
Hi,

Can you guys help me giving a function that takes all the contents in a particular field

IIS & NW MII on the same server
Hi,

We're weighing the possibility to run both IIS and MII (NetWeaver) on the same server

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

losing variables between php brackets
Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys

reading partial code from external site
Hi,

I am trying to write a script for my website to get an article from an external website.

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

Linux socket programming
Where can I find a good introduction to socket programming?

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