Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the new custom colors to the colors API (CS:S, TF2, HL2:DM, DOD:S) #10

Open
berni2288 opened this issue Jul 27, 2012 · 6 comments
Assignees

Comments

@berni2288
Copy link
Member

The following games now support the new custom colors:

  • TF2
  • CS:S
  • HL2:DM
  • DOD:S

The following new control characters can be used now in the usermessage SayText2:

\x07

Followup bytes (as string): RRGGBB

\x08 (supports alpha)

Followup bytes (as string): RRGGBBAA

Todo: implement this in the smlib colors API

I don't know why Valve decided to specify the color code as string, as this is not efficient, 1 byte for each color part would have been better to save banwidth, but ok.

https://forums.alliedmods.net/showthread.php?t=185016
https://forums.alliedmods.net/showthread.php?p=1717390

@ghost ghost assigned berni2288 Jul 27, 2012
@berni2288
Copy link
Member Author

The first step is done: parsing RGB(A) color tags.

The following are valid tags:

  • {#RGB}
  • {#RRGGBB}
  • {#RGBA}
  • {#RRGGBBAA}

Example:

{#F00F} to print red text with full opacity.

Left todo:

  • Add new color names that will resolve to RGB automatically
  • Allow the definition of own RGB color names
  • Automatic fallback for games that do not support it.
  • Allow a list of colors in the form {#F00,R,G} to make it able to define fallback colors in the tags itself.

@TheCreatorX
Copy link

Will you be adding CSGO colors like purple? I think the tag is \x03.

@ghost
Copy link

ghost commented Nov 15, 2013

All CS:GO Colors:
PrintToChat(client, " \x01\x0B\x01 Default,\x02 Darkred,\x03 Purple,\x04 Green,\x05 Lightgreen,\x06 Lime,\x07 Red, \x08 Grey, \x09 Orange");

@berni2288
Copy link
Member Author

Yes, I can add those colors, please create a new issue for that as this one is for the RGB colors.

@TheCreatorX
Copy link

Sure thing, added a new issue with further detail.

@Nerus87
Copy link

Nerus87 commented Nov 5, 2016

Better idea is integrate morecolors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants