RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Extended Colour Palette

0 Members and 2 Guests are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Extended Colour Palette
Version: 1.0
Author: modern algebra
Date: February 13, 2010

Version History


  • <Version 1.0> 02.13.2010 - Original Release

Description


This script allows you to have more colours beyond the 32 in the windowskin. It's primary use will be in messages, as you can now put in codes higher than \c[31]. Any numbers below 32 will take the colours from the windowskin.

Features

  • Allows you to have a colour palette of more than 32 colours.

Instructions

Read the header for instructions. A sample colour palette is attached to the bottom of this post.

Script


Code: [Select]
#==============================================================================
#    Extended Colour Palette
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: February 13, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to have more colours beyond the 32 in the
#   windowskin. It's primary use will be in messages, as you can now put in
#   codes higher than \c[31]. Any numbers below 32 will still take from the
#   windowskin.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instruction:
#
#    Just place this script in its own slot in the Script Editor (F11) below
#   the default scripts, but still above Main. Then make a new picture in
#   System named whatever you have ECP_COLOUR_PALETTE_NAME as at line 38 (by
#   default, ColourPalette). In that picture, set the colours you want in 8x8
#   squares. It must have a width of 64, but can be as high as you want. To get
#   the first colour in the new palette, it is 32, and it advances to the
#   right, and then down to the next row.
#==============================================================================

#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new constant - ECP_COLOUR_PALETTE_NAME
#    aliased method - text_color
#==============================================================================

class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * CONSTANTS
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # This is the name of the file that holds the extra colours you want to use
  ECP_COLOUR_PALETTE_NAME = "ColourPalette"
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Text Colour
  #    n : the colour desired
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalra_extndcolor_txtcolr_5ft1 text_color
  def text_color (n, *args)
    if n > 31
      colour_palette = Cache.system (ECP_COLOUR_PALETTE_NAME)
      n -= 32
      x = 4 + ((n % 8) * 8)
      y = 4 + ((n / 8) * 8)
      return colour_palette.get_pixel(x, y)
    else
      modalra_extndcolor_txtcolr_5ft1 (n, *args)
    end
  end
end

Credit


  • modern algebra

Support


Please post in this topic at RMRK for support. Do not PM me.

Known Compatibility Issues

No known compatibility issues.


Creative Commons License
This work by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.

****
Rep:
Level 83
Very nice. I never would have thought of this.