CommandColour Function

Posted by Terry on Sat 12 Jul 2008 02:48 PM — 2 posts, 12,208 views.

USA #0
First off, I sorta feel bad making all these somewhat trivial posts...
Anyway, is there a function that sends the name of the output color being used for commands? Before, I had always used:
ColourNote ("silver", "", "I'm a colored note! And stuff! Yay!")
With the newer versions, however, it's now a light shade of red that I can't even find on the extended colors list! :p


A side note: Is there a way of previewing a post before it's posted?
Amended on Sat 12 Jul 2008 02:53 PM by Terry
Netherlands #1
You have probably changed the color using Input>Commands, and not realized it. You can change it back there. Or, you can use a smarter script function to solve your issue and have your notes change along with the worlds settings from now on forth:

function FakeInput(text)
  -- Is this world to actually display input?
  if (world.GetOption("display_my_input") == 1) then
    local inputColorFG = world.GetNormalColour(8)  -- use standard foreground
    local inputColorBG = world.GetNormalColour(1)  -- use standard background
    
    -- If a colour has been specified, use that instead.
    if (world.GetOption("echo_colour") > 0) then
      inputColorFG = world.GetCustomColourText(world.GetOption("echo_colour"))
      inputColorBG = world.GetCustomColourBackground(world.GetOption("echo_colour"))
    end
    
    -- Finally, output the stuff.
    world.ColourNote(world.RGBColourToName(inputColorFG),
                     world.RGBColourToName(inputColorBG), text)
  end
end

-- Use it like...
FakeInput("Wazzam~!")