Nicohk92 wrote:
0.87451 0.67451 0.529412 1,
0.87451 x 255 gives 223.00005
so that's 223 correct?
yes! for completeness (and rounded): (0.87451, 0.67451, 0.529412, 1} * 255 = {223, 172, 135, 255} = {DF, AC, 87, FF} => #DFAC87
========================================================
Nicohk92 wrote:hayasidist wrote:
(I'm assuming that you're Ok with different number bases -- decimal and hexadecimal (hex) ?? say if not and I'll explain)
I wouldn't mind as I'm more of a dark poking kind of guy at this point.
decimal means "count in tens"; hexadecimal means "count in sixteens"... and counting in sixteens means counting up until you get to fifteen before you roll it over.
Counting in tens is relatively new idea: English numbers have special words up to 12 before recognizing the decimal at "three and ten" (thirteen). Italian goes straight to "one and ten" (undici); but in French numbers up to sixteen have special words before they recognise the decimal and swap to "ten and seven".
Back in pre-decimal British currency, money WAS counted in 12s .. 15 [old] pence was generally said as "one and three" [one shilling and three pence]
And imagine that the French language kept that counting system, so what we'd all now say as 17, Francophones would write and say as (e.g.) un et seize .. and so on until quinze et seize then deuxSeizes and so on ... with (e.g.) quatre et deuxSeizes written as (say) 2s4
imperial weights still use 16 ounces to a pound e.g. 2lb 4oz; as do US fluid measures 2pints 4 ounces.
so take a number such as 24
In common usage we'd say twenty four (two tens and four)
But in hexadecimal (usually said simply as "hex") we'd say "two four" -- that's two SIXTEENs and four = 2*16 + 4 = 32+4 (decimal) = 36 (decimal)
now those clever Arabs who gave us our (decimal) number system hadn't given us special symbols for the numbers after 9, so we improvise with letters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F; and stick a small x (or 0x or ...) in front so we know that we're using hex: e.g. 0x24 to differentiate from 24 (decimal)
converting from decimal to hex is pretty easy for numbers up to 255: divide the decimal number by 16: the remainder is the last digit; the "answer" (the quotient) is the first digit. so taking 223 from the above: 223/16 = 13 remainder 15; 13 is written as "D" and 15 as "F" => xDF. 172/16 = 10 rem 12 => xAC I'll leave you to do the last one (135.).
Convention for colours is we stick a # sign in front of the RGB (hex) values ... so from the opening example: #DFAC87
Hope that makes sense! Shout if not.