How do the colors work (forecolor etc) -1 reply

Please wait...

JaedenRuiner

Crazy Coding SP Guy...

50 XP

27th December 2002

0 Uploads

168 Posts

0 Threads

#1 10 years ago

In the menu system there are forecolor and backcolor and a whole slew of other "color" markings, and they all look something like this:

forecolor .615 .615 .956 1

What are each of these and how do they translate. In PaintShop or PhotoShop i have Red Green and Blue of 0 to 255, but i don't see how they translate to decimal notations. is it a percentage or something? And the last digit, the 1, what is that? I thought it was alpha or something but i don't know what it means or how it will effect the final design. I'll be doing some tests, but it would be nice ot have some more descriptive explanations.

Thanks Jaeden "Sifo Dyas" al'Raec Ruiner




heath1992

A well-oiled toaster oven

50 XP

26th January 2007

0 Uploads

298 Posts

0 Threads

#2 10 years ago

Each number there is a "normalized" color component. Meaning you divide each of the natual red green, blue, and alpha components of the color by 255. This makes it so each component is somewhere between 0 and 1. So this is what the section you posted means: forecolor R/255 G/255 B/255 A/255 Where R, G, B, and A are the red, green, blue, and alpha, components of the color. All you need to do to get the color is multiply each of the red, green, and blue components given by 255 to get the natural color. Here's the natural color: 156.825, 156.825, 243.78, and 255 for the alpha (255 out of 255 is full opacity). Hope that helps. :)