[Ajuda] Salvar cor em hexadecimal
#2

Код:
stock HexToInt( string[ ] )
{
    if( string[ 0 ] == 0 ) return ( 0 );

    new i;
    new cur = 1;
    new res = 0;
    for( i = strlen( string ); i > 0; i -- )
    {
        if( string[ i - 1 ] < 58 )
        {
            res = res + cur * ( string[ i - 1 ] - 48 );
        }
        else
        {
            res = res + cur * ( string[ i - 1 ] - 65 + 10 );
            cur = cur * 16;
        }
    }
    
    return ( res );
}
Reply


Messages In This Thread
Salvar cor em hexadecimal - by Lessk - 18.07.2013, 21:40
Re: Salvar cor em hexadecimal - by steki. - 18.07.2013, 21:42
Re: Salvar cor em hexadecimal - by Lessk - 18.07.2013, 21:46

Forum Jump:


Users browsing this thread: 1 Guest(s)