Source Code Simple Color struct to your overlay :)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

vikingtiger911

PLBB
Dank Tier Donator
Nobleman
Apr 1, 2015
78
793
0
Hello guz.. so here's basically a color class that i made yesterday.
Enjoy.

C++:
class Colors {
public:
	int r() {
		return colors[0];
	}

	int g() {
		return colors[1];
	}

	int b() {
		return colors[2];
	}

	int a() {
		return colors[3];
	}

	Colors(int _r, int _g, int _b) {
		SetColor(_r, _g, _b);
	}

	Colors(int _r, int _g, int _b, int _a) {
		SetColor(_r, _g, _b, _a);
	}



	void SetColor(int _r, int _g, int _b) {
		colors[0] = (unsigned char)_r;
		colors[1] = (unsigned char)_g;
		colors[2] = (unsigned char)_b;
		colors[3] = 1.f;
	}

	void SetColor(int _r, int _g, int _b, int _a) {
		colors[0] = (unsigned char)_r;
		colors[1] = (unsigned char)_g;
		colors[2] = (unsigned char)_b;
		colors[3] = (unsigned char)_a;
	}
private:
	unsigned char colors[4];
};
Usage:

C++:
void doYourStuff(Colors color) {
blablabla your function etc.
glColor4f(colors.r() / 255.f, colors.g() / 255.f, colors.b() / 255.f, colors.a() / 255.f);
}

doYourStuff(Colors(255, 0, 0, 255));
:heartless::heartless:
 

Lukor

ded
Meme Tier VIP
Fleep Tier Donator
Dec 13, 2013
490
5,353
25
Thanks for sharing!

You could make it use only one SetColor() by defining it like this:
C++:
void SetColor(int _r, int _g, int _b, int _a = 255) {
	colors[0] = (unsigned char)_r;
	colors[1] = (unsigned char)_g;
	colors[2] = (unsigned char)_b;
	colors[3] = (unsigned char)_a;
}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
so you guys both released a shittier version of a SDK class? Bravo! :trollface:
 

vikingtiger911

PLBB
Dank Tier Donator
Nobleman
Apr 1, 2015
78
793
0
Rake;42795 said:
so you guys both released a shittier version of a SDK class? Bravo! :trollface:
Exactly, but i don't see how it's "shittier" when sethxi got an exact copy of the color class.
And if you think this color class is "shittie" i'll share you the mega class for ya.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Exactly, but i don't see how it's "shittier" when sethxi got an exact copy of the color class.
And if you think this color class is "shittie" i'll share you the mega class for ya.
I'm just messing with you, that's why I put a trollface :)
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods