Hi,
I've just bought an e-book titled "LOVE for Lua Game Programming".
I've read some page and I found this code as example:
love.graphics.setColor(0,0,0,225)
love.graphics.setBackgroundColor(255,153,0)
Why the first line has 4 numbers (RGB is identified by only 3 numbers)?
Thank you!
I don't understand the using of RGB in LOVE
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: I don't understand the using of RGB in LOVE
Hi!
The fourth argument to setColor controls opacity/transparency when drawing. A value of 255 means fully opaque / no transparency, and a value of 0 means fully transparent. Anywhere in between means partial transparency.
The fourth argument to setColor controls opacity/transparency when drawing. A value of 255 means fully opaque / no transparency, and a value of 0 means fully transparent. Anywhere in between means partial transparency.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: I don't understand the using of RGB in LOVE
It's actually RGBA (the A defaults to 255) http://en.wikipedia.org/wiki/RGBA_color_space
When I write def I mean function.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: I don't understand the using of RGB in LOVE
And of course the background is RGB, instead of RGBA because your background can't be transparent (what would be behind it?)
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: I don't understand the using of RGB in LOVE
Conspiracy theory!bartbes wrote:And of course the background is RGB, instead of RGBA because your background can't be transparent (what would be behind it?)
Re: I don't understand the using of RGB in LOVE
Bartbes, I think there might be a secret cookie factory behind it.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: I don't understand the using of RGB in LOVE
What about "what is behind it.", e.g. the desktop, or another window, or both, or whatever... though i'm sure that there would be some nontrivial (like cross-platform/windowing system) problems in implementing this, assuming it'd even be possible.bartbes wrote:And of course the background is RGB, instead of RGBA because your background can't be transparent (what would be behind it?)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Bing [Bot] and 10 guests