User Tag List

Results 1 to 7 of 7

Thread: RGB colors

  1. #1
    Esteemed Member <span style='color: #4169E1'>Grandelf</span>'s Avatar
    Join Date
    Oct 2014
    Posts
    104
    XP
    64,547
    Level
    78
    Thanks
    18
    Thanked 110 Times in 45 Posts

    RGB colors

    General information
    I decided to do a small release that may not be of any use to you at all.
    However if you're interested in this type of thing or use a lot of colors in your scripts
    this might be useful to you.
    So why have RGB colors when we can already use hexadecimal codes?
    Absolutely no reason, I just had this idea in my head for a while and wanted
    to do something different aswell as freshing some things up.
    It may actually be a little easier to use colors and memorize them with this script,
    especially if you have no idea what a hexadecimal number is.

    So what does this do?
    This is a script that will allow you to use RGB colors. You basically call a function and
    it will convert it into a usable color code for you.

    How does it work?
    For those of you who don't really know what RGB is, you can either look it up on google
    or read my explanation. RGB basically stands for R (red), B (blue) and G (green).
    With those three colors you can mix around and create 16777216 colors to be exact.
    For each color type you use a number between 0 and 255. The number depends on
    how intense you want the color to be.



    Some examples:

    Red:
    Code:
    255, 0, 0
    We are using the highest intensity on the first argument (red), the other two are 0
    which means they are not used at all.

    Dark(er) red:
    Code:
    150, 0, 0
    Here we are using a lower intensity on red then before and the other two are 0 again.
    Because the intensity is lower the color we get will be darker.

    Green:
    Code:
    0, 255, 0
    Here we are only using the 2nd one (green) on the highest intensity

    Purple:
    Code:
    255, 0, 255
    Here we mix up red with blue which makes purple (see picture above).

    More examples: RGB colors

    How to use this script?

    Simply put it in your scripts folder. Then use the global function to get a color code.
    Code:
    local red = RGB(255, 0, 0);
    So to send a red message to a player you could do:
    Code:
    function sendRedMessage(player)
            local red = RGB(255, 0, 0);
            player:SendBroadcastMessage(red .. "This message will be red");
    end
    Script: http://pastebin.com/b4TFN7Ti

    Grandelf.

  2. The Following 5 Users Say Thank You to Grandelf For This Useful Post:


  3. #2
    Founder <span style='color: #FF4500'>Tommy</span>'s Avatar
    Join Date
    Apr 2013
    Posts
    7,391
    XP
    3,449,104
    Level
    378
    Thanks
    889
    Thanked 1,856 Times in 1,119 Posts
    Great release!

  4. #3
    Banned
    Join Date
    Mar 2014
    Location
    Under your bed
    Posts
    69
    Thanks
    7
    Thanked 5 Times in 5 Posts

  5. #4
    Founder <span style='color: #FF4500'>Hyperion</span>'s Avatar
    Join Date
    Apr 2013
    Posts
    4,929
    XP
    757,167
    Level
    154
    Thanks
    1,390
    Thanked 1,184 Times in 631 Posts
    Quote Originally Posted by shotsofdeath98 View Post
    He already has that link in his post =P
    Achievements:
    Got a Sticky! Referrer Conversationalist 1 year registered Member Level XL Level C
    Awards:
    Member of Staff Support Smartass LOL Scripter Repacker Picasso Most Threads Facepalm! Pot Head On the fly Raffle Winner Drunk
    Upvote our public Teamspeak 3 Server!

  6. #5
    Super Moderator <span style='color: #FFFF00'><span class='glow_000000'>Kaev</span></span>'s Avatar

    Join Date
    Jan 2014
    Location
    Germany
    Posts
    535
    XP
    2,925,321
    Level
    335
    Thanks
    76
    Thanked 102 Times in 70 Posts
    Awesome release! A version for C++ scripts would be nice for those, who doesn't use Eluna.
    Achievements:
    Shopper Member 1 year registered Level XL Level C
    Awards:
    Raffle Winner Member of Staff Support LOL Drunk Donator


    Read the rules before posting.

    Do you have an unsolved issue? Give us more informations about your problem.

    Do you have problems with compiling or installing TrinityCore? Unknown96's Tutorial will help you.

    Visit our other helpful sites:
    EmuDevs SQL Generator

  7. #6
    Enthusiast
    Join Date
    Nov 2013
    Posts
    21
    XP
    2,454
    Level
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How to Use it? Let's insert this function in the Gossip?

  8. #7
    Exalted Member Syphex's Avatar
    Join Date
    Dec 2014
    Location
    Sweden GMT + 1
    Posts
    297
    XP
    169,093
    Level
    105
    Thanks
    50
    Thanked 37 Times in 29 Posts
    Quote Originally Posted by Avatar789 View Post
    How to Use it? Let's insert this function in the Gossip?
    It's explained at the end of the post. - -
    How to use this script
    Simply put it in your scripts folder. Then use the global function to get a color code.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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