Converting colors from 'normal' to embed
#9

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Ah, fair enough! How does it remove the 0x and FF though?
The trick is in the size of the strings. A string is basically an array with a value for each character and a final value of NUL to signify the end of string. Keep in mind that array keys start at zero. Mean sets the size of finalchr to seven, meaning that only a string six characters in length can fit inside of it. He then formats the string using color[2], which returns the value of color starting from the third character. The first two characters are therefore omitted, leaving us with the "FFFFFFFF". This is eight characters long and so when it tries to fit in to finalchr, the last two characters are omitted to make room, leaving us with "FFFFFF".
Reply


Messages In This Thread
Converting colors from 'normal' to embed - by Mean - 27.08.2013, 23:36
Re : Converting colors from 'normal' to embed - by Matnix - 27.08.2013, 23:40
Re: Converting colors from 'normal' to embed - by Vule. - 27.08.2013, 23:41
Re: Converting colors from 'normal' to embed - by Luis- - 27.08.2013, 23:51
Re: Converting colors from 'normal' to embed - by Mean - 27.08.2013, 23:54
Re: Converting colors from 'normal' to embed - by Luis- - 28.08.2013, 00:01
Re: Converting colors from 'normal' to embed - by Mean - 28.08.2013, 00:45
Re: Converting colors from 'normal' to embed - by Luis- - 28.08.2013, 02:25
Re: Converting colors from 'normal' to embed - by Squash - 28.08.2013, 03:48
Re: Converting colors from 'normal' to embed - by Vince - 28.08.2013, 07:46

Forum Jump:


Users browsing this thread: 1 Guest(s)