Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   RGB/Hex Color Functions (https://forums.graalonline.com/forums/showthread.php?t=79719)

Tigairius 05-13-2008 01:15 AM

RGB/Hex Color Functions
 
1 Attachment(s)
I dunno... I was bored...

This script converts Graal RGB colors into the hex color table format and vice versa.

Example of use:
PHP Code:

echo("#FF0000 converted in to RGB: " HextoRGB("#ff0000"));
echo(
"1,0,0 converted to hex is: " RGBtoHex(1,0,0)); 

Would return:
PHP Code:

#FF0000 converted in to RGB: 1,0,0
1,0,0 converted to hex is#FF0000 


xXziroXx 05-13-2008 03:05 AM

Nice! :O

cbk1994 05-13-2008 03:13 AM

Nice, will help when I'm to lazy to look things up for GUIs etc.

I would rep you, but alas, I have must spread the greatness around :cry:

Programmer 05-13-2008 03:17 AM

Quote:

Originally Posted by Tigairius (Post 1390555)
I dunno... I was bored...

This script converts Graal RGB colors into the hex color table format and vice versa.

Example of use:
PHP Code:

echo("#FF0000 converted in to RGB: " HextoRGB("#ff0000"));
echo(
"1,0,0 converted to hex is: " RGBtoHex(1,0,0)); 

Would return:
PHP Code:

#FF0000 converted in to RGB: 1,0,0
1,0,0 converted to hex is#FF0000 


Already made in my function pack, look near the bottom and you'll see it.

Tigairius 05-13-2008 03:20 AM

Quote:

Originally Posted by Programmer (Post 1390576)
Already made in my function pack, look near the bottom and you'll see it.

Oh >_< I wish I saw that sooner, I think I like mine better anyways (no offense). I noticed yours uses a for loop in several places, it's not quite as efficient as mine is.


All times are GMT +2. The time now is 05:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.