Some questions about the button widget

Hi all,

Have some questions.

I define a new button like so : 

    local buttonAnswerThree = widget.newButton     {         parent = sceneGroup,         defaultFile = "buttonAnswer.png",         overFile = "buttonAnswer.png",         label = "ANSWER THREE",         --emboss = true,         --font = "Sans Poster Bold JL",         labelColor = { default = { 130, 82, 42 }, over = { 163, 25, 12} }         --onRelease = buttonAnswerOnePressed,     }

The label color however, does not seem to be working properly.

As soon as one of the r,g,b values have a value > 0, they seem to become 255.

e.g. {1,0,0} , the label will be completely red.

Am I doing something wrong here ?

Also, if i want to build for android, how would I go about  changing the fonts for the label.

If i define it like the above ( pointing to a system font in windows ), there will be an error when building for android.

 Thanks in advance!

Starting sometime a couple of years ago, we moves away from 0…255 for color ranges and changed from 0…1, where 0 is no color, 1 is 100% of the color.  If you want a medium red, you would use { 0.5, 0, 0 }.  If you have your colors in a 0…255 range, simply divide by 255 to get their fractional value:

default = { 130 / 255, 82 / 255, 42 / 255 }

Thanks for the reply.

Most of the examples on the web were still using 255, I guess that was what was confusing me.

As for the second part of my question i found the answer here :

https://docs.coronalabs.com/guide/system/customFont/index.html

Thanks again

Starting sometime a couple of years ago, we moves away from 0…255 for color ranges and changed from 0…1, where 0 is no color, 1 is 100% of the color.  If you want a medium red, you would use { 0.5, 0, 0 }.  If you have your colors in a 0…255 range, simply divide by 255 to get their fractional value:

default = { 130 / 255, 82 / 255, 42 / 255 }

Thanks for the reply.

Most of the examples on the web were still using 255, I guess that was what was confusing me.

As for the second part of my question i found the answer here :

https://docs.coronalabs.com/guide/system/customFont/index.html

Thanks again