Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


colors check help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Nov 02, 2008 10:51 am    Post subject: colors check help Reply with quote

right now a creating program like ACTool and it works fine now i just have to add some more commands

and right now im on adding a check color command and wondering whats the best way

should it check for RGB to check if value = blue for example or should it check for the exactly value in hex

if i should use RGB to check the color which should be the best i have another question

the 3 base colors is Blue, Green , Red
if i check an pixel and the pixel is blue does blue have the highest value then?

and how should i make a check for this because if i find another color like brown the value will be something spread out and the check will probably show wrong result

the problem with the check should be that there is so many combination that making same colors

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sun Nov 02, 2008 11:13 am    Post subject: Reply with quote

What language? I'll assume C++.
Use getpixel to get the color at a certain pixel, which is stored in a colorref structure.
To compare colors, just compare the colorref structures.
Use GetRValue, GetGValue, and GetBValue macros to split the colorrefs into rgb.
Complete blue would be 0,0,255. However, colours are mixed to create other colors, for example 255,255,255 is white; 0,0,0 is black; 100,100,100 is a grey; 255,0,255 is a dark purple; and 125,0,125 is a light purple.
Each exact colour can only have one RGB code, but different variants of the colour have different RGB codes.
If you are asking what combinations make up certain colours, well with most, that's a matter of opinion. For example, 0,0,100 and 0,0,200 are both blues, but we would probably say that 1,0,100 is still a blue, but in fact it is a very blue purple.
For other colours like orange, it get's more complicated.

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Nov 02, 2008 11:26 am    Post subject: Reply with quote

--Pillboi-- wrote:
What language? I'll assume C++.
Use getpixel to get the color at a certain pixel, which is stored in a colorref structure.
To compare colors, just compare the colorref structures.
Use GetRValue, GetGValue, and GetBValue macros to split the colorrefs into rgb.
Complete blue would be 0,0,255. However, colours are mixed to create other colors, for example 255,255,255 is white; 0,0,0 is black; 100,100,100 is a grey; 255,0,255 is a dark purple; and 125,0,125 is a light purple.
Each exact colour can only have one RGB code, but different variants of the colour have different RGB codes.
If you are asking what combinations make up certain colours, well with most, that's a matter of opinion. For example, 0,0,100 and 0,0,200 are both blues, but we would probably say that 1,0,100 is still a blue, but in fact it is a very blue purple.
For other colours like orange, it get's more complicated.


well i know everything about how to get the color and stuff it is just the part when i should check the color

and for example 1,0,100 is purple is right but for human it is blue and the check should be for human(the color should be for human) and thats make it harder :/

well i hope someone know a easy way else i have to sit down and do the dam color check for some hour probably

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Sun Nov 02, 2008 11:31 am    Post subject: Reply with quote

To make it easier, you could, as you mentioned yourself, just make the user define a RGB value to search for.
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Nov 02, 2008 11:44 am    Post subject: Reply with quote

Moller wrote:
To make it easier, you could, as you mentioned yourself, just make the user define a RGB value to search for.


well it would be the easiest and i may do it but the fact that the script could be useless (the check color part) if they just move the window like a mm

making me thing twice since it should be a noob friendly program
(i try to improve my skills a bit so i dont always want it the easiest way because then i wont learn something new)

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sun Nov 02, 2008 1:57 pm    Post subject: Reply with quote

ups2000ups wrote:
The check should be for human(the color should be for human) and thats make it harder :/

The problem is, as I said before, it is then a matter of opinion.
The best you can do is to decide ranges which you interpret as one colour.
For example: 0,0,20 to 0,0,255 is blue; 20,0,10 to 255,0,255 is purple.
These are just examples that may be completely incorrect, you have to decide for yourself.

Edit : Maybe this will help: http://www.vbforums.com/showthread.php?t=366592
Edit : Check this: http://www.on-the-matrix.com/webtools/HtmlColorCodes.aspx
Edit 2 : These too: http://forums.devshed.com/software-design-43/algorithm-to-determine-rgb-colour-ranges-between-2-set-colours-378911.html
http://web.njit.edu/~kevin/rgb.txt.html

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Mon Nov 03, 2008 1:42 am    Post subject: Reply with quote

--Pillboi-- wrote:
ups2000ups wrote:
The check should be for human(the color should be for human) and thats make it harder :/

The problem is, as I said before, it is then a matter of opinion.
The best you can do is to decide ranges which you interpret as one colour.
For example: 0,0,20 to 0,0,255 is blue; 20,0,10 to 255,0,255 is purple.
These are just examples that may be completely incorrect, you have to decide for yourself.

Edit : Maybe this will help: http://www.vbforums.com/showthread.php?t=366592
Edit : Check this: http://www.on-the-matrix.com/webtools/HtmlColorCodes.aspx
Edit 2 : These too: http://forums.devshed.com/software-design-43/algorithm-to-determine-rgb-colour-ranges-between-2-set-colours-378911.html
http://web.njit.edu/~kevin/rgb.txt.html


thanks Very Happy

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Nov 03, 2008 10:36 am    Post subject: Reply with quote

--Pillboi-- wrote:
To compare colors, just compare the colorref structures.
Use GetRValue, GetGValue, and GetBValue macros to split the colorrefs into rgb.


Why do this? The RGB macro is so much simpler if you're just trying to compare.

Also COLORREF is just a dword.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites