Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-13-2008, 01:15 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
RGB/Hex Color Functions

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 
Attached Files
File Type: txt colorfunc.txt (1,013 Bytes, 303 views)
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #2  
Old 05-13-2008, 03:05 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Nice! :O
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 05-13-2008, 03:13 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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
__________________
Reply With Quote
  #4  
Old 05-13-2008, 03:17 AM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
Quote:
Originally Posted by Tigairius View Post
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.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #5  
Old 05-13-2008, 03:20 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Programmer View Post
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.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”

Last edited by Tigairius; 05-13-2008 at 06:58 AM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:20 AM.


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