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.
[VXA] Extended Colour Palette

0 Members and 1 Guest are viewing this topic.

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

Version History


  • <Version 1.0> 2012.02.04 - 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 use more colours for text display than provided in the windowskin

Instructions

Paste this script into its own slot in the Script Editor, above Main but below Materials.

You will need to make a "Palette" graphic and save it in the System folder of Graphics. The format of the "Palette" Graphic should be that it is 64 pixels wide. Each colour should be in an 8x8 square and you can have as many rows of them as you like. It will count left and then down, so 32-39 would be colours on the first row, 40-47 would be colours on the second row, etc. The graphic must be named "Palette".

A sample palette graphic:

Using that palette, \c[36] would show the text in the brown colour, first row, fifth column.

Script


Code: [Select]
#==============================================================================
#    Extended Colour Palette
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: February 4, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  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.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot in the Script Editor, above Main but
#   below Materials.
#
#    You will need to make a "Palette" graphic and save it in the System folder
#   of Graphics. The format of the "Palette" Graphic should be that it is 64
#   pixels wide. Each colour should be in an 8x8 square and you can have as
#   many rows of them as you like. It will count left and then down, so 32-39
#   would be colours on the first row, 40-47 would be colours on the second
#   row, etc. The graphic must be named "Palette".
#==============================================================================

$imported ||= {}
$imported[:MA_ExtendedColourPalette] = true

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

class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Text Color
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mamc_textcolor_4rj6 text_color
  def text_color(n, *args, &block)
    if n < 32
      mamc_textcolor_4rj6(n, *args, &block) # Call Original Method
    else
      n -= 32
      Cache.system("Palette").get_pixel((n % 8) * 8, (n / 8) * 8)
    end
  end
end

Credit


  • modern algebra

Support


Please post in this thread at RMRK.net if you have any bugs to report or questions to ask.

Known Compatibility Issues

No known compatibility issues.

Author's Notes


I have been working on tedious scripts, so I figured I'd do something quick.
« Last Edit: January 31, 2013, 09:49:18 PM by modern algebra »