Alternative \c[x] text colors

Alternative \c[x] text colors

Description

In messages, you can type in \c[x] (where x is some number between 0 and 8 inclusive) to turn the text after that a different colour. Those colours, unfortunately, aren't the best and they're not easy to work with (as of v17.2).

This resource is a rewrite of the method which generates these colours. It has these results:
  • The colour codes are now easier to work with, as they are in standard RGB format rather than the fiddly 15-bit four-digit format.
  • The existing colour shades have been tweaked and improved.
  • Four new colours have been added (\c[9] through \c[12]).
  • Improved support for dark windowskins, as now the base and shadow colours are swapped for dark backgrounds, making them look a bit nicer.
Here are the available colours:

Untitled.png

  • 1 = Blue
  • 2 = Red
  • 3 = Green
  • 4 = Cyan
  • 5 = Magenta
  • 6 = Yellow
  • 7 = Grey
  • 8 = White
  • 9 = Purple
  • 10 = Orange
  • 11 = Light Blue
  • 12 = Pink
Installation

To make use of this resource, simply locate def getSkinColor and replace it with the code below.
Ruby:
def getSkinColor(windowskin,color,isDarkSkin)
  if !windowskin || windowskin.disposed? ||
     windowskin.width!=128 || windowskin.height!=128
    # Base color, shadow color (these are reversed on dark windowskins)
    textcolors = [
       "1880F8","B0C0F8",   # 1  Blue
       "F83018","F8B0A0",   # 2  Red
       "18C020","A8E8A8",   # 3  Green
       "40C0D0","A8E0E8",   # 4  Cyan
       "D030C0","E8B0D8",   # 5  Magenta
       "E0D820","F8F0A8",   # 6  Yellow
       "98A0B0","D0D0D8",   # 7  Grey
       "F0F0F0","C0C0C0",   # 8  White
       "9018F8","D0A0F0",   # 9  Purple
       "F89810","F8D0A0",   # 10 Orange
       "A0D0F8","D8E0F8",   # 11 Light Blue
       "F8A8D8","F0D8E0"    # 12 Pink
    ]
    if color==0 || color>textcolors.length/2   # No special colour, use default
      if isDarkSkin   # Dark background, light text
        return shadowc3tag(MessageConfig::LIGHTTEXTBASE, MessageConfig::LIGHTTEXTSHADOW)
      end
      # Light background, dark text
      return shadowc3tag(MessageConfig::DARKTEXTBASE, MessageConfig::DARKTEXTSHADOW)
    end
    # Special colour as listed above
    if isDarkSkin   # Dark background, light text
      return sprintf("<c3=%s,%s>",textcolors[2*(color-1)+1],textcolors[2*(color-1)])
    end
    # Light background, dark text
    return sprintf("<c3=%s,%s>",textcolors[2*(color-1)],textcolors[2*(color-1)+1])
  else   # VX windowskin
    color = 0 if color>=32
    x = 64 + (color % 8) * 8
    y = 96 + (color / 8) * 8
    pixel = windowskin.get_pixel(x, y)
    return shadowctagFromColor(pixel)
  end
end
Notes

This resource's code is taken from Essentials v18, albeit with different colour shades. The shades in this resource are an older and more vibrant revision of the colours in Essentials v18, and are provided for the sake of variety.

For reference, the shades in older versions of Essentials are:
Ruby:
       "8080F8","4040B8",   # 1 Blue
       "F88080","B84040",   # 2 Red
       "80F880","40B840",   # 3 Green
       "80F8F8","40B8B8",   # 4 Cyan
       "F880F8","B840B8",   # 5 Magenta
       "F8F880","B8B840",   # 6 Yellow
       "C0C0C0","808080",   # 7 Grey
       "F8F8F8","B8B8B8"    # 8 White
See also

The resource Improved Colored Text also provides alternate text colours. You can take the colour codes from that resource and put them into this resource's code if you want - just be careful to take only the colour codes themselves and not the <c3= and > parts.
Credits
None needed
Author
Maruno
First release
Last update
Rating
0.00 star(s) 0 ratings
Top