English Scripting colors

11 replies
Goto Page
To the start Previous 1 Next To the start
02.06.13 04:43:07 pm
Up
Xirot
User
Offline Off
I saw some comments in the filearchive/script. Asking in comments about how to set the colors in the luas.
Well , this site will help you.
For who don't know , how to use it.
Spoiler >

I hope that this will help you guys.
#Discord CS2D Rework - https://discord.gg/pbhdVdj
02.06.13 04:44:43 pm
Up
limonata
User
Offline Off
Thank you its really good
02.06.13 04:56:01 pm
Up
Assassin moder
User
Offline Off
It's combination of three basic colors: Red, Green and Blue

RRRGGGBBB

minimum value is 0 (000) and maximum is 255.
02.06.13 05:42:14 pm
Up
Alistaire
User
Offline Off
Or if you want a specific color from an image, get Photofiltre and use the colorpicker..
IMG:http://i.imgur.com/5zhwOTP.png
02.06.13 05:59:52 pm
Up
Xirot
User
Offline Off
user Alistaire: How the fuck? you're advicing peoples to get the photofiltre to know the script colors ? that's stupid.
> www.colorpicker.com exists.
#Discord CS2D Rework - https://discord.gg/pbhdVdj
02.06.13 06:44:33 pm
Up
Alistaire
User
Offline Off
user Xirot has written:
user Alistaire: How the fuck? you're advicing peoples to get the photofiltre to know the script colors ? that's stupid.
> www.colorpicker.com exists.


You obviously can't read. I told them that you can find the RGB value for a color in a certain image with Photofiltre's colorpicker.
IMG:http://i.imgur.com/5zhwOTP.png
02.06.13 07:53:29 pm
Up
Shawni
User
Offline Off
I can see that people never experienced drawing.
We die once, do i have to hide to be visible ?
02.06.13 09:05:13 pm
Up
J_Lucas
User
Offline Off
nice for who dont know ...
03.06.13 01:36:32 am
Up
krabob
User
Offline Off
@user lucass: yes
People help the people
03.06.13 10:03:17 am
Up
Xirot
User
Offline Off
user lucass: me , you brazil ronaldo. Hahaha.
user J_Lucas: Yeah , that's why I posted this.
user Alistaire:
Quote:
get Photofiltre and use the colorpicker
#Discord CS2D Rework - https://discord.gg/pbhdVdj
07.06.13 11:41:20 am
Up
VaiN
User
Offline Off
Since we're talking about scripting colors, here's how I prefer to set up colors in my Lua scripts.

Create a table called color. Create a variable to hold the copyright character (this prevents issues with file format like UTF-8/ANSI, so you can use whatever text editor you like without concern). Then concatenate the values, giving each color an entry in the table (without spaces in the color name). You can use the advice in posts above for getting the color values.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
color = {}
color.code = string.char(169) -- copyright character code
color["black"] = color.code .. "000000000"
color["white"] = color.code .. "255255255"
color["red"] = color.code .. "255000000"
color["green"] = color.code .. "000128000"
color["blue"] = color.code .. "000000255"
color["yellow"] = color.code .. "255255000"
color["cyan"] = color.code .. "000255255"
color["orange"] = color.code .. "255165000"
color["purple"] = color.code .. "128000128"
color["pink"] = color.code .. "255192203"


Then you can easily reference the color using color.name or color["name"]
Code:
1
msg( color.red .. "Banhammah!" )


To take it a step further, I usually set variables to define colors for specific output such as chat output from the server.
Code:
1
2
3
color.server = color.cyan -- for public output
color.notification = color.green -- for private output
color.advertisement = color.orange -- for adverts


Then you don't have to change every msg() color if you decide to change colors in those cases. I usually keep this all in a separate file so it's easily shared for use in other scripts. Just my advice for keeping things simple.

I generated a table from all of the Microsoft.NET colors if anyone wants it (147 colors total).
To the start Previous 1 Next To the start