setColor bug

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Paulo Soreto
Prole
Posts: 1
Joined: Thu Aug 09, 2018 1:36 am

setColor bug

Post by Paulo Soreto » Thu Aug 09, 2018 1:47 am

In the wiki (https://love2d.org/wiki/love.graphics.setColor), says:
"In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1."
This really works fine when I use setColor(number, number, number), the range is 0 to 255, but when I pass a table that contains the colors the range is 0 to 1.
Is this a bug or setColor behavior are correct?

I'm using love 11.1:
Image

Sorry if there are any errors in this topic.

User avatar
D0NM
Party member
Posts: 194
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: setColor bug

Post by D0NM » Sun Aug 12, 2018 6:09 pm

Please quote your code here.

And since you are using Love 11.1, then
your colour values range is 0 ... 1

e.g. Set some grey colour:

Code: Select all

love.graphics.setColor(0.45, 0.45, 0.45)
black:

Code: Select all

love.graphics.setColor(0, 0, 0)
white:

Code: Select all

love.graphics.setColor(1, 1, 1)
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests