|
Post by bulldogg on Jul 26, 2008 18:15:48 GMT
0xFF000001 what format is that above for the colors? if its like a different bit for each value to have like bold, underline and colours ect im gonna get confused
|
|
|
Post by Eagle on Jul 26, 2008 20:18:24 GMT
You can refer to this page for details about the style attribute. Unfortunatelly the formatting of the comments there is missing so its a bit hard to read, I'll see if I can fix that. All info is there though but breaking the above down would get you the following: 0xFF000001 => (blue=0xFF; green=0x00; red=0x00; bold(bit 0)=true)
|
|
|
Post by SyntaxError on Jul 26, 2008 21:54:38 GMT
aint that the way flhook does colours? freelancerserver.de/v2/topic,15011_Change_colours_in_flhook.html Quote from freelancerserver.de/v2/topic,15011_Change_colours_in_flhook.html - <TRA .../> NODE SYNTAX - the data field of a TRA node consists of an RGB value along with format specifications: <TRA data="0xBBGGRRFF" mask="-1"/> BB is the blue value GG is the green value RR is the red value FF is the format value (all in hexadecimal representation) format flags are: bin hex dec effect 00000001 1 1 bold 00000010 2 2 italic 00000100 4 4 underline 00001000 8 8 big 00010000 10 16 big&wide 00100000 20 32 very big 01000000 40 64 smoothest? 10000000 80 128 smoother? 10010000 90 144 small simply add the flags to combine them (e.g. 7 = bold/italic/underline)
|
|
|
Post by Eagle on Jul 26, 2008 22:52:48 GMT
Its the way flserver does color so yes, same format.
|
|
|
Post by bulldogg on Jul 27, 2008 10:16:17 GMT
yay...still confused soo it does
0xBBGGRR so red would be 0x25500 ? or does it work like hex so red would be 0xFF0000?
is there any website that can generate the hex/code?
|
|
|
Post by Eagle on Jul 27, 2008 13:10:22 GMT
In programming languages 0x is often used to prefix hexadecimal numbers, as is the case here. Click this link to get some background information on how this number system works as its just a different means to represent numbers... one which is closer to how these are stored on a computer. In the style parameter, different parts have been broken down into individual bytes, even bits. The online documentation has been updated in the mean time so please refer to that for details. As for converting regular numbers to hex... just use the windows calculator, it has all you need build in allready ^^
|
|
|
Post by countcornelius on Aug 1, 2008 17:13:37 GMT
We were using this on flhook but its in the same format, for those that doesn't want get involved into hexdecimals this is the easy one:
0x99F921 ORANGE 0xFF000021 BLUE 0x00FF0021 GREEN 0xe900e921 PURPLE 0x0000FF21 RED
|
|
|
Post by bulldogg on Aug 1, 2008 17:14:35 GMT
yay
|
|
|
Post by Eagle on Aug 2, 2008 9:40:31 GMT
Note that with hex 21 at the end you not only have bold face, but also the largest possible font (Squared font, size 6). Accurate documentation concerning can be found here.
|
|
|
Post by blackbeard on Aug 9, 2008 11:24:26 GMT
sorry to bump this but would the following:
0x0000FF39
be Red, Bold, Big and Squared font, size 4
its the last two digits im not all too sure on do we just add all the hex values up and thats the number
for instance what would it be for: blue, bold, italic, smoothest, Rounded font, size 4
thanks BlackBeard
if you could explain your answer for the above example that would be awesome
|
|
|
Post by Eagle on Aug 9, 2008 23:58:58 GMT
0x0000FF39 is composed as follows: Byte 0 (0x39)Written as binary this gives you 0011 1001 or 0x38 + 0x01 in bit components as shown in docs 7654 3210 (bit positions) 0011 1000 (0x38) 0000 0 001 (0x01) Bit 0: 1 (bold is on) Bit 1: 0 (italic is off) Bit 2: 0 (underlined is off) Bit 3-7: 0x38 (Squared font, size 1) Byte 1 (0xFF)Red component is decimal 255 or maximum red value. Byte 2 (0x00)No green component. Byte 3 (0x00)No blue component. End result is therefor bold, red, Squared font, size 1 text. So how does one get blue, bold, italic, Rounded font, size 4? We'll take a look at the docs again and find that Rounded font, size 4 has multiple possibilities that will work so we'll just take the 1st one in the list which is 0x10 or 0001 0000 binary. The last 3 bits would become 1 for bold (on), 1 for italic (on) and 0 for underline (off) in proper binary order that would give us 011 (see docs for bit order), 011 binary equals 0x03 and adding that to 0x10 makes... 0001 0000 (0x10) 0000 0011 (0x03) ------------------------- + 0001 0011 (0x13) Now the color components would be 0 for red and green and 0xFF for blue or 0xFF0000 for bytes 1 through 3, stick byte 0 behind that and we get 0xFF000013. Hope that clears things up for you, see also hexadecimal on wiki for explanation on this number system.
|
|