color range format - hexadecimal better?

Production of artwork for the game by regular contributors takes place here.

Moderator: Forum Moderators

Post Reply
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

color range format - hexadecimal better?

Post by Sapient »

The current format for specifying color ranges for team color is comma-separated RGB decimal triplets. I was using some of this code recently and it occurred to me how much cleaner and easier to use it would be in hexadecimal. Since you artists are the ones who use this feature, I thought I'd pose the question to you. Here's the overview.

Color ranges would be more readable in the FFFFFF,FFFFFF format, instead of the 255,255,255,255,255,255 format. Currently, it's easy to lose track of which color you're looking at with all those commas. Also, the string itself would become much shorter. The main place these are going from/to is the color-chooser box in graphical editing programs, which means you would only have to copy and paste once instead of three times. Another thing, using the ~TC image path extension would look clearer for custom ranges, such as "my.png~TC(1,FFFF00,EEEE00)" instead of "my.png~TC(1,255,255,0,238,238,0)"
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

there are standard C function (strtoi I think) to convert strings to integer

these function recognises the following syntaxes

0xXXXX (hex)
0XXXX (octal
XXXX (decimal)
XXXXb (binary)

we could probably use that to parse the numbers...
Fight key loggers: write some perl using vim
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

boucman - Well, seems like an unnecessary abstraction to me. If we allow multiple formats that will make it more confusing, not less, and it would increase the length of the string instead of decreasing it. It would probably mean writing 0xFF,0xFF,0xFF instead of FFFFFF, which would kind of defeat the whole purpose.

My view is that there aren't that many of these definitions in the official release, so it would be simpler to keep them all in the same format.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Until an actual artist speaks up...

...I assume they get the values from the photoshop color sliders or something similar (eyedropper, color analyzer, etc.). It's probably an extra step to have to retrieve hex values for a color.
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

scott - well, I don't own a copy of Photoshop, but I can say that GIMP and Paintshop Pro both allow you to paste a hex value FFFFFF into the color chooser. The reason for this feature, no doubt, is because this format is used so often during web design.

The one program that this would not apply to is probably going to be MS Paint, which we do know that Neorice uses. Still, if you're just going to be using the magenta color swatches, MS Paint will work fine.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

A] We've already specified *the* color range for team color. We technically could make a new one, but have no need to do so.

In mainline, at least, there will be no other color ranges - all of the old ones are being/have been removed.

B] I don't really care about the difficulty either way, since it's something done so rarely.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

FYI, this is implemented in trunk now.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

That's a good thing.
it's no harder to find a hex color value than the RGB in photoshop, easier, in some ways, because you can get the whole thing by copying one field.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Post Reply