Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Red, Green, Blue, Alpha Bytes within colour, colour integer

Author
Message
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 15th Mar 2012 16:36 Edited at: 15th Mar 2012 17:21
Hi,

Been looking through commands:-

- how do I pick a colour from a pixel/image pixel?

- how do I get or set/change the red, blue, green and/or alpha bytes in a colour?

- how do I actually get the colour integer value?

- is it RGBA integer or ARGB integer - or something else?

- could there be RGB, ARGB, RRGB, GRGB and BRGB functions?

ie. so we can intelligently calculate correct border, background and shadow or aura colours around texts, buttons, sprites etc...

is it all down to >> this and << that...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th Mar 2012 02:39
Ping...
?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Mar 2012 09:56
Currently there are no commands to get a pixel colour from an image. I'm not sure if they will be included in the next release either.

Colour is generally dealt with using separate values for each colour component IE. setSpriteColor(spriteID, red, green, blue, alpha)

You can pass alpha values into these but I don't know if they are just rounded to the nearest integer.

I hope that helps!

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th Mar 2012 09:58
@ baxslash,

Cheers. I think I can manage with the sprite and text color commands and those UCF draw commands for now...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 20th Mar 2012 17:07
This thread has a "color picker" that you can use to return a color as a DWORD or a hex string, but AppGameKit uses R,G,B,A values for its colors.

Since AppGameKit user functions are limited to 9 parameters, using four parameters for color values is not very efficient, so I tend to use a hex string and break it up into the four values.

Even if you don't want to use the color picker, you could extract the relevent lines for your own "hex string to color values" function.

Just a thought.

Login to post a reply

Server time is: 2024-11-23 05:23:35
Your offset time is: 2024-11-23 05:23:35