color in corona?

how to divide RGB: 7B9F35 ? it used to be with 255 … not i see it with letters ?

7B9F35 is Hexadecimal values (base 16 numbers).  7B is the red component, 9F is the green component and 35 is the blue component.  We don’t have an easy way to convert Hex to decimal (base 10) numbers for Corona to work with.  You can find string recipes to convert hex to decimal.  There are plenty of online converters that will take that string and give you the decimal values you need.  You can even use Adobe Photoshop to do it.

Rob

Same thing, the numbers are in hexadecimal. Unless you are changing these colours a lot or working on a lot of objects the time taken to do the division shouldn’t really matter. It’s certainly easier to edit like this.

setFillColor(0x7B/255,0x9F/255,0x35/255)

As an aside, could setFillColor and setStrokeColor have alternative behaviour if g = b = nil, viz, interpret the r component as a RGB value , as the 6 hex RGB is fairly common.

In the bottom right corner of http://colorschemedesigner.com/ you have “Color Tables” tab which has the different kinds of values. 

I use this web based tool to find the hex and RGB values of colors:  http://www.colorpicker.com/

Alternatively, something like http://cloford.com/resources/colours/500col.htm which lists the colours by category. And can spell ‘colour’ … (ducks) if I had a pound for every syntax error generated because of COLOR rather than COLOUR I’d be in the Seychelles.

thanks all for your contribution and sharing you knowledge . I have more options now. :slight_smile:

I appreciate it

Abdul

When working with other people, I sometimes ask them to go to this page and give me the names of the colors they want to use.

http://en.wikipedia.org/wiki/X11_color_names

Or, if you’re using Outlaw you can just highlight the color numbers and a color picker will pop up. You can see an example in this short video:

http://youtu.be/awD_ARv8rvA

That shows the first version in CPM, but the current version in Outlaw uses the 0-1 colors instead of 0-255.

 Jay