RGB, RGBA, Hex
2 Attachment(s)
Some shitty tutorial. (Copy most text from wiki)
There have been this new chat color feature in few source games for a while, let's look how we could "make" these color values. Custom chat color use a hex triplet (three-byte hexadecimal number), where bytes represent the red, green and blue components of the color (RGB). In hexadecimal FFFFFF. Where one color channel range is in hex 00 - FF, in decimal 0 - 255 "Note that if any one of the three color values is less than 16 (decimal) or 10 (hex), it must be represented with a leading zero so that the triplet always has exactly six digits." For example, wrong way (%X) PHP Code:
PHP Code:
But this can be more easier. (Found from google, but seems bl4nk have also posted before) This how combine all three color channels to one. (RGB to Hex) PHP Code:
Explain to me
These above (RGB) now works with chat color character "\x07" https://dl.dropbox.com/u/38118182/pi...color_text.png PHP Code:
Another chat color character "\x08", require four color channel (RGBA) where last channel is Alpha, modify text opacity/transparency. Almost same way as above but we add one more hex byte = two hex digits. And now remember also that formating, 8 hex digit (%08X) PHP Code:
PHP Code:
Yes, can do even more simple than those before. Just add straight Hex color value in output text, or use text. https://dl.dropbox.com/u/38118182/pi...olor_text2.png PHP Code:
We can do also this in translation files, not need edit plugin :3 I attached test translation phrase, hope those characters not get erased after uploading here. https://forums.alliedmods.net/attach...7&d=1546730165 More here #22 Sry for bad english and lot of text with misspellings, typos, wrong info. *edit Use NotePad++ |
Re: RGB, RGBA, Hex
Ok, sry. I take this second post
hex-triple to back decimal-triple (explain later) PHP Code:
|
Re: RGB, RGBA, Hex
Quote:
|
Re: RGB, RGBA, Hex
Quote:
TF2, CS:S, HL2DM, DOD:S, Garry's Mod, etc. |
Re: RGB, RGBA, Hex
Quote:
Thanks Asherkin, and thanks for the tutorial Bacardi. |
Re: RGB, RGBA, Hex
is dis possible to make in gldsrc?
|
Re: RGB, RGBA, Hex
Quote:
[SOLVED][CSS] How to use multiple team colors in one message |
Re: RGB, RGBA, Hex
Quote:
https://forums.alliedmods.net/showthread.php?t=186784 https://forums.alliedmods.net/showthread.php?t=187570 https://forums.alliedmods.net/showthread.php?t=186340 https://forums.alliedmods.net/showthread.php?t=186695 cople of posts that have in-game picutes: https://forums.alliedmods.net/showpo...7&postcount=14 https://forums.alliedmods.net/showpo...0&postcount=36 |
Re: RGB, RGBA, Hex
Quote:
Quote:
|
Re: RGB, RGBA, Hex
Quote:
|
All times are GMT -4. The time now is 03:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.