Raised This Month: $51 Target: $400
 12% 

Looking for Stock that convert hex code to rgb.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crewparadise
Member
Join Date: Jun 2015
Location: Seoul, South Korea
Old 06-01-2016 , 15:38   Looking for Stock that convert hex code to rgb.
Reply With Quote #1

I've found that stock which can convert rgb code to hex with this
PHP Code:
stock rgbToHex(RGBA=255bool:withAlpha=false
{
         return 
withAlpha ? ((0xff) << 24) | ((0xff) << 16) | ((0xff) << 8) | (0xff) : ((0xff) << 16) | ((0xff) << 8) | (0xff);} 
But i could not found opposite thing Anyone have?? Thanks for read!

Last edited by crewparadise; 06-01-2016 at 15:39.
crewparadise is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 06-02-2016 , 09:12   Re: Looking for Stock that convert hex code to rgb.
Reply With Quote #2

https://forums.alliedmods.net/showth...&highlight=hex
Mitchell is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 06-03-2016 , 21:51   Re: Looking for Stock that convert hex code to rgb.
Reply With Quote #3

the thing gonna like this.
PHP Code:
char chHexString[] = "007FFF";
int iHexiRGBA[4];
StringToIntEx(chHexStringiHex16);
hexToRGB(iHexRGBA);
PrintToServer("%i, %i, %i"RGBA[0], RGBA[1], RGBA[2])

stock hexToRGB(int Hexint RGBA[4], bool withAlpha=false)
{
    if(
withAlpha/*Hex > 0xFFFFFF*/// Hell No...
    
{
        
RGBA[0] = ((Hex >> 24) & 0xFF);
        
RGBA[1] = ((Hex >> 16) & 0xFF);
        
RGBA[2] = ((Hex >> 8) & 0xFF);
        
RGBA[3] = ((Hex) & 0xFF);
    }
    else
    {
        
RGBA[0] = ((Hex >> 16) & 0xFF);
        
RGBA[1] = ((Hex >> 8) & 0xFF);
        
RGBA[2] = ((Hex) & 0xFF);
    }

I didnt test it
__________________
Sorry about my poor English


Last edited by Blowst; 06-03-2016 at 21:58.
Blowst is offline
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 -4. The time now is 17:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode