List of skin colors
Skin colors are translation maps that replace a specified range of palette colors used in sprites with other colors. They are most commonly used by players to change the colors of the character skin they are currently using, typically recoloring the character's main body color; in multiplayer gametypes players are usually able to freely change their skin color, while in Single Player all characters have a default skin color that cannot be changed. However, other types of Objects in SRB2 make use of skin colors too – e.g.: emblems in vanilla SRB2 use skin colors to help identify what type of emblem they are, and CTF Team Rings are rings recolored using skin colors to match the color of the team that can collect them.
By default, the range of colors that will be changed by skin colors is the green range (palette colors 160–175). For most types of Objects this is hardcoded, and cannot be altered by any means. For players however, the startcolor parameter in a character's
S_SKIN allows for some flexibility; the range of colors to swap will always be 16 colors directly next to each other in the palette, but startcolor allows the starting color of this range to be modified. The rest of the colors will follow after the color set by startcolor, the final color of the range being 15 colors after it. Through startcolor this range can in fact also cross over multiple ranges of colors in the palette, though this is generally not desirable in practice. This trait works only if the player is currently using the
SPR_PLAY sprite set – changing to any other sprite set will reset the changeable color range to the default green range. Note that this also applies to the icons for the Level End Sign and Extra Life Monitor.
A_ChangeColorRelative can be used to change the skin color of an Object for SOCs; for Lua,
player.mo.color) is the current skin color value set for an Object. For players,
player.skincolor is the player's selected "normal" skin color in multiplayer (or the default color, in Single Player); the player may change to other colors when they have turned super or have special power-ups such as the Fire Flower power-up or invincibility in Mario mode levels, but this value acts as the fallback skin color to use when they are no longer super or don't have the listed power-ups anymore.
Normal skin colors
The table below lists the available skin color choices available to players and other objects, listing both the named constants for use in SOC/Lua (listed in the "Internal name" column) and the name strings for use with the
color console variable or prefcolor in a character's
S_SKIN (listed in the "Name" column). The columns "#1" to "#16" denote the range of colors to replace each of the 16 colors from the palette to be swapped in-game. Note that many of the colors overlap several columns, to show that they are shared.
|Value||Internal name||String name||#1||#2||#3||#4||#5||#6||#7||#8||#9||#10||#11||#12||#13||#14||#15||#16|
SKINCOLOR_NONE/"None" was a former skin color choice for players in older versions of SRB2, but is now not available for multiplayer, and is not recommended for usage with prefcolor in a character's
S_SKIN. For all other objects, it is the default skin color set when an object is first spawned on the map, as most objects do not use skin colors.
MAXSKINCOLORS represents the total number of normal skin colors available, though this includes the "None" color choice.
Super skin colors
Following the normal skin colors above, these special skin colors are reserved for super forms – the default super yellow, Tails' super orange, and Knuckles' super pink/red. The flashing seen in-game for all three super colors is simluated by cycling continuously through a set of 5 different skincolors ranging from bright to dark. None of these colors are intended for use in-game by anything except super players, though if these colors are given to a player or other object otherwise the flashing does not occur automatically.
In the table below, the columns "#1" to "#16" have the same meaning as with the table for normal skin colors above. "Used by" refers to which vanilla SRB2 character's super form uses each group of skin colors; they are not string names to be used in-game for the
color console variable nor prefcolor in the
|Value||Internal name||Used by||#1||#2||#3||#4||#5||#6||#7||#8||#9||#10||#11||#12||#13||#14||#15||#16|
||Super Sonic (Default)||120||96||97||98||99||100||101|
MAXTRANSLATIONS represents the total number of skin color translations available to use in SRB2, including both normal skin colors and super skin colors.
Skin color opposites
Certain skin colors of the normal range have a corresponding "opposite" skin color. These are used to modify the Level End Sign's background color in particular; depending on the player's current skin color, the End Sign's background will change its color to the corresponding "opposite" skin color if one exists. However, as the End Sign's background is a single shade rather than multiple, the End Sign also has to modify the sprite frame used for the background since a single shared shade does not work in practice across all skin colors – to get around this, it has 16 different frames (H–W) to choose from for the 16 different shades, one of which is determined for each opposite skin color. These frames for the End Sign actually run in increasing order of brightness; H is the darkest shade, and W is the lightest shade. Most skin colors currently do not have an "opposite" skin color set.
Handling of opposite skin colors and their appropriate shade for the End Sign is done by
A_SignPlayer. Note that the frame number is actually increased by an amount rather than simply being modified. The table below lists the respective opposite skin colors for each skin color, along with the amount added to the frame number and the resulting frame character and color shade used by the End Sign itself (frame = H + frame increment; shade = #16 - frame increment; 0 = H = #16, 1 = I = #15, 2 = J = #14, etc):
|Skin color||Opposite color||Frame increment||End sign frame||End sign shade|
A_SignPlayer, another way to access these opposite skin colors is through the special Lua function
ColorOpposite. This function returns both the opposite skin color's number and the frame increment value for use with the End Sign.