Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.89 KB

Colors.md

File metadata and controls

51 lines (41 loc) · 1.89 KB

Colors

Colors are very commonly used in huds.

Color Format

All colors in tf2 follow the RGBA format (red green blue alpha) using decimal numbers between 0 and 255. For example, the following will set a label to be pure white and completely opaque:

	"fgcolor" "255 255 255 255"

Example Colors

Name Ex Code
Black #000000 0, 0, 0, 255
White #FFFFFF 255, 255, 255, 255
Gray #7F7F7F 127, 127, 127, 255
Red #FF0000 255, 0, 0, 255
Green #00FF00 0, 255, 0, 255
Blue #0000FF 0, 0, 255, 255
Yellow #FFFF00 255, 0, 0, 255
Cyan #00FFFF 0, 255, 255, 255
Magenta #FF00FF 255, 0, 255, 255

There are several good resources for mixing colors, such as:

Additive Colors

Fonts and some panels can use additive colors, by using the additive tag:

	"additive" "1"

Additive colors add their rgb values to whatever is below them. For example, if you had a panel with the color:

	"bgcolor" "255, 100, 0, 255"

And added a panel with additive colors above it with the color:

	"bgcolor" "0, 100, 200, 255"

The resulting color drawn to the screen will be:

	255+0, 100+100, 0+200, 255 = 255, 200, 200, 255

As a consequence, if an additive color is white, the resulting color will always be white. To lighten a color, you can add an additive with some gray as its color.