HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Color for texts

07-29-2007, 09:28 PM#1
Dooblivion
I wana make some cool effects in my text using different
colors but i only know how to make the color yellow...|cffffcc00 |r
Can anyone show me a list of colors please?
07-29-2007, 09:41 PM#2
darkwulfv
Umm. Well, there's programs that do that for you. Check the Map Editing tools section, im sure we've got at least 1.
07-30-2007, 05:26 PM#3
Dark.Revenant
It's easy.

The first two characters just set it up while the last two characters tell it where to end.

The first two "ff"'s should pretty much always be "ff"'s, so don't change them. They control the alpha channel of the text and the effect is fundamentally broken.

The six letters afterwards are the thing you must change; they control the Red, Green, and Blue. I'll use a graphic to show you:
|cffffcc00|r
This color code, as you should know, creates the warcrafty yellowish-gold color. However, you can fill in the correct spaces with different number to create different combinations of channels, therefore different colors.

To do this, you must know how hexadecimal codes work. Instead of 10 numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), you have 16 numbers, which are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f. You may, at first, think that this is a stupid and tedious way of doing things. However, it is actually very useful, as with two regular decimal numbers you can have a total of 100 combinations, but with two hexadecimal numbers you can have a total of 256 combinations. Say, where have you seen the number 256 before, hmm?

It's very simple to figure out a conversion of the codes. If you want an aqua-like color, with 0% red, 35% green, and 90% blue, you simply each number by 2.56. 0 red, 89.6 green, and 230.4 blue. You can now use this in the tinting values in the editor. Next step is to make it be hexadecimal characters. The easiest way to do this is to divide by 16, take the remainder away and keep that number safe, and then convert the numbers above 9 to their corresponding letters. 0/16=0 r=0 Red, 89.6/16=5 r=9.6 Green, 230.4/16=14 r=6.4 Blue. For the conversions... 00 Red, 5a Green, and e6 Blue.

Our color code for 0% R, 35% G, 90% B is |cff005ae6TEXT TEXT|r
07-30-2007, 05:29 PM#4
darkwulfv
That's atrociously confusing. I think it'd be far easier to just pick up a program that does it all for you. I know we've got at least 1 in our tools section.
07-30-2007, 06:58 PM#5
Castlemaster
http://html-color-codes.com/
If you're artistically uninclined like me, there are plenty of websites that offer an easy to read color code system. Just know that increasing the alphanumerical value (going 0, 1, 2...f) of all 3 colors will lighten, and decreasing the alphanumerical value (going f, e, d...0) will darken it. Other than that it's just ratios.
07-30-2007, 07:40 PM#6
darkwulfv
That's for HTML though, not wc3 hex colorcode. It's sorta based off the same system, but I'm still insisting he just gets a hex editor coloring program, like Chaos Spectrum. In fact, I'll zip and post and folder here since it's an .exe, not an installation program.

Chaos Spectrum has almost everything you could think to need. (Color blends, inverse color blends, rainbow text, solid text, etc.), AND it can do HTML if you want.

Since it's my copy, it may have theme's already in the list (fire theme, water theme, etc.), I'm not sure. but I got this from wc3sear.ch, and since the site died I'm not sure where to get it any more. But this coloring program is a beaut. Just unzip, open the folder, and run the Chaos Spectrum 1.1.exe. Plain and simple.
Attached Files
File type: zipChaos Spectrum.zip (845.6 KB)
07-30-2007, 07:51 PM#7
Dark.Revenant
I'm sorta forced to do coloring my way, as I can't run .exe's. I just passed on my knowledge in case someone needs it...
07-30-2007, 11:55 PM#8
darkwulfv
Ah, that sucks =\. Chaos spectrum is a really nice program though, very user-friendly and lots of options.
07-31-2007, 02:35 AM#9
Pyrogasm
...Or you could do something like this, which turns a string + RGB values into a colored string:
Collapse JASS:
function GetColoredString takes string whichString, integer Red, integer Green, integer Blue returns string
    local integer Remainder
    local integer Result
    local integer array Colors
    local integer I = 0
    local string ColorCode = ""

    set Colors[3] = Red
    set Colors[2] = Green
    set Colors[1] = Blue

    loop
        set I = I+1
        exitwhen I > 3
        loop
            exitwhen Colors[i] == 0
            set Result = Colors[i]/16
            set Remainder = R2I(ModuloReal(I2R(Colors[i]), 16.00)*16.00)
            if Remainder < 11 then        
                set ColorCode = I2S(Remainder)+ColorCode
            elseif Remainder == 11 then
                set ColorCode = "A"+ColorCode
            elseif Remainder == 12 then
                set ColorCode = "B"+ColorCode
            elseif Remainder == 13 then
                set ColorCode = "C"+ColorCode
            elseif Remainder == 14 then
                set ColorCode = "D"+ColorCode
            elseif Remainder == 14 then
                set ColorCode = "E"+ColorCode
            elseif Remainder == 15 then
                set ColorCode = "F"+ColorCode
            endif
            set Colors[i] = Result
        endloop
    endloop
    return "|c"+ColorCode+whichString+"|r"
endfunction

Didn't test that, though.
07-31-2007, 03:10 AM#10
Earth-Fury
forgot alpha, didn't you pyro? |cAARRGGBB text |r
07-31-2007, 05:51 AM#11
Pyrogasm
Fuck.

return "|cff"+ColorCode+whichString+"|r"
08-02-2007, 04:28 PM#12
Castlemaster
So the first part of the color code, the "cff" is alpha channel. Forgive me for artistic ignorance but what exactly is an alpha channel?
08-02-2007, 04:57 PM#13
darkwulfv
actually it's the "ff". But the alpha channel is transparency. However, it doesn't work in wc3, so don't try. just keep it "ff".