1. #1

    How to color messages printed by addons?

    Why?
    I am trying to develop a script/addon to make fake chat lines. Not trying to do this for shaming of guildies or so... i'm actually just doing this to prove guys on another forum that blacklisting "ninjas" by using user submmited screenshots may be not fair.

    So...?
    How do I color part of the string returned by AddMessage() or any other command?

    Then...
    Thank you for any response i may get here
    Last edited by darkbreaker; 2010-06-11 at 01:29 AM. Reason: wrong command
    Quote Originally Posted by Simbert
    You gain 4 additional girlfriends once you stop playing WoW. It is statistically proven that WoW equals 4 girlfriends. No one exactly know where they come from, but WoW is the only thing that prevents the world from being flooded with insane amounts of girls.

    Actually, that is the sole reason we even play WoW. We simply could not stand all those girlfriends jumping at you at every corner of the street if we didn´t.

  2. #2
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    |crrggbb (rr, gg, bb, being the color values in hex format and RGB order) starts the colored section - to return to "normal" text color, use |r.

  3. #3
    The colour of the text is defined by its red, green and blue components from 0 to 1.
    Not sure of an easy way to determine the colour of any specific text you intend to recreate, but the following seems to work after testing briefly with an addon which outputted text to the chat.


    AddMessage("This is some Text",1,0,0)
    - Will output it in a red colour.
    AddMessage("This is more Text", 255/255, 192/255, 192/255)
    - Will output in the default General chat colour which is normally 255/192/192 (according to wowwiki) using the usual 0-255 terminology, and showing how to convert that to the 0-1 form.
    As for determining any specific colour then that is up to you, either through a sceenshot and colour picker or through code, which is rather beyond my limited knowledge.

    I used the following for reference, and maybe the third will be more helpful to you than it was to me.
    http://www.wowwiki.com/API_Scrolling...ame_AddMessage
    http://www.wowwiki.com/API_ChangeChatColor

    http://www.wowwiki.com/Creating_your_own_chat_types

  4. #4
    Deleted
    Slight correction: the color code is actually
    Code:
    |caarrggbb
    , but the alpha value does nothing - just leave it at ff.

  5. #5
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    Thanks for the correction, Treeston.

    And thank you for the way to make AddMessage work, ComputerNerd.

  6. #6

    Post

    Quote Originally Posted by ComputerNerd View Post
    The colour of the text is defined by its red, green and blue components from 0 to 1.
    Not sure of an easy way to determine the colour of any specific text you intend to recreate, but the following seems to work after testing briefly with an addon which outputted text to the chat.

    As for determining any specific colour then that is up to you, either through a sceenshot and colour picker or through code, which is rather beyond my limited knowledge.

    I used the following for reference, and maybe the third will be more helpful to you than it was to me.
    http://www.wowwiki.com/API_Scrolling...ame_AddMessage
    http://www.wowwiki.com/API_ChangeChatColor

    http://www.wowwiki.com/Creating_your_own_chat_types
    Thank you for the info! I was wondering how to convert from hex to 0-1, then you saved me a lot of time

    Quote Originally Posted by Taryble View Post
    |crrggbb (rr, gg, bb, being the color values in hex format and RGB order) starts the colored section - to return to "normal" text color, use |r.
    This is even better so i can color names by class.

    Also tank you Treeston for the correction about the alpha.
    Quote Originally Posted by Simbert
    You gain 4 additional girlfriends once you stop playing WoW. It is statistically proven that WoW equals 4 girlfriends. No one exactly know where they come from, but WoW is the only thing that prevents the world from being flooded with insane amounts of girls.

    Actually, that is the sole reason we even play WoW. We simply could not stand all those girlfriends jumping at you at every corner of the street if we didn´t.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •