Can Someone Define Magenta?

Contribute art for mainline Wesnoth.

Moderator: Forum Moderators

Forum rules
Before posting critique in this forum, you must read the following thread:
Post Reply
tvynr
Posts: 49
Joined: March 21st, 2006, 6:11 pm

Can Someone Define Magenta?

Post by tvynr »

Hi there. I'm a proto-sub-amateur novice sprite artist (read: programmer who has spent a couple hours in the same room as GIMP) and a friend of mine and I were interested in creating a couple of units for use in an era we want to assemble (read: shamelessly modifying the mainline units because I have no appreciable artistic skill).

I am to understand that the TColors on units are accomplished by the classic translate-the-ugly-color scheme. In this case, magenta is being replaced with the team color in question. My question: what, exactly, is magenta?

My first guess was that the image was loaded into memory using HSB samples and that, then, all pixels of a certain hue would be translated, shifted, or something like that. However, upon examination of the Master at Arms, I see that he uses all sorts of magenta hues between H=324 and H=334.

So is there a range of hues which I can assume to be magenta? And, out of curiosity, is my understanding of the hue-shift correct? I'd assume, looking at the rendered sprites, that there's some saturation changing as well. Or am I completely off?

Thanks for reading! Cheers, all!
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Click Create at the top of the website. Then click Art. Then scroll down to the section Sprite Art, then click Team Color Shifting
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 »

It's more of a "a specific set of RGB values are hue and luminosity shifted to other values" thing.

The specific set, I went and made a PNG image of - that's the "Team-Color Swatch" listed on that page.

So just open that PNG and sample the colors, making absolutely sure that your graphics program is not shifting the RGB values of that PNG when it opens it (this being an area where color "correction" backfires).
tvynr
Posts: 49
Joined: March 21st, 2006, 6:11 pm

Post by tvynr »

Ah, yes. When I had originally read that page (Create :: Art :: Sprite Art :: Team Color Shifting), I had thought that the gradient was simply provided as an example of magenta, not a definition. And an examination of the definition of the "MAGENTA_IS_THE_TEAM_COLOR" macro did not reveal much, considering that it simply says "flag_rgb=magenta" (where "magenta" is presumably defined somewhere else).

So that specific set of RGB values is what is used and no others?? Is there any kind of mathematical pattern to those RGB values (in terms of RGB, HSB, CMYK, etc.) or were they picked only for their appropriateness in terms of team colors? I am writing some small snippets of throwaway code to automatically modify images. If I understand correctly, I can just embed the 19 colors in that swatch to define the logic which determines whether a pixel is team colored or not.

Thanks muchly for your help! :)
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Yes, and the precise rgb values for "magenta" are defined in the file team-colors.cfg (near the bottom). Note that the first RGB triplet in the team color range definition is also its median luminosity specification. All this is explained on the wiki as well.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply