• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Floating Text Colored Yellow

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
You can't do it that way since yellow is primary colour you need to use a colour code.
this is all the colour codes
Red: |CFFFF0303text here|R
Blue: |CFF0042FFtext here|R
Teal: |CFF1BE6D8text here|R
Purple: |CFF540081text here|R
Yellow: |CFFFFFF01text here|R
Orange: |CFFFE8A0Etext here|R
Green: |CFF20C000text here|R
Pink: |CFFE55BB0text here|R
Grey: |CFF959697text here|R
Light Blue: |CFF7EBFF1text here|R
Dark Green: |CFF106246text here|R
Brown: |CFF4E2A04text here|R
Neutral: |CFF272727text here|R
 
You can't do it that way........

  • Damage Detection
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage taken) Not equal to 0.00
        • Then - Actions
          • Set p = (Position of (Triggering unit))
          • Set R1 = (X of p)
          • Set R2 = (Y of p)
          • Custom script: call RemoveLocation(udg_p)
          • Floating Text - Create floating text that reads ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Triggering unit)) Less than 70.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Triggering unit)) Less than 40.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Percentage life of (Triggering unit)) Greater than 30.00
                    • Then - Actions
                      • Floating Text - Change the color of (Last created floating text) to (0.00%, 0.00%, 100.00%) with 0.00% transparency
                    • Else - Actions
                      • Floating Text - Change the color of (Last created floating text) to (100.00%, 0.00%, 0.00%) with 0.00% transparency
                • Else - Actions
                  • Floating Text - Change the color of (Last created floating text) to (0.00%, 100.00%, 100.00%) with 0.00% transparency
            • Else - Actions
        • Else - Actions
As you can see, the color is changable via (%,%,%)
0%,100%,100% gave me teal instead of yellow
Does anyone knows how to fix this?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
maybe I was unclear, I know that there is a field you can edit but it's a fact that yellow is a primary colour and not a mix between two colours

got the fact from here
http://answers.yahoo.com/question/index?qid=20110525171126AAD7s6A
"Nothing makes yellow, it's a primary color
Someone obviously failed art class"
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
it's a fact that yellow is a primary colour and not a mix between two colours
That's not a fact. There are 3 primary colors: Red, Blue and Green. Yellow's not one of them.
Yellow is a mix between Red and Green. Setting both to 100% would result in yellow.
If you would like an image of that:
AdditiveColor.svg

As you can see: there are the 3 primary colors that overlap each other. Yellow is where green and red overlap.

(This is for light. Paint/printing is different, but not used very often on computers).

Edit: I find it strange that you use Red-Green and Blue to create yellow yourself ("Yellow: |CFFFFFF01"), yet you think yellow is a primary color.
The code "ffff01" means "255 255 001", or 100% red, 100% green, 0.3% blue.
 
Level 18
Joined
May 11, 2012
Messages
2,103
  • Floating Text - Create floating text that reads ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
If true:
  • Floating Text - Create floating text that reads (|CFF0042FF) + ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
else:
  • Floating Text - Create floating text that reads (|CFFFFFF01) + ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
 
  • Floating Text - Create floating text that reads ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
If true:
  • Floating Text - Create floating text that reads (|CFF0042FF) + ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
else:
  • Floating Text - Create floating text that reads (|CFFFFFF01) + ((String((Integer((Percentage life of (Triggering unit)))))) + %) at (Point(R1, R2)) with Z offset 50.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
after color = |r or not?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Thanks


HOW TO CONVERT HEXADECIMEL INTO PERSENTAGE?

take number on left

times it by 16 (A = 10, B = 11, C = 12, D = 13, E = 14, F = 15)

add them together

9B = (9 * 16 + 11) = (144+11)=155%

e/ oops.. took me a while to realize something stupid...

now 155/255= 60.7%
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Shouldn't google provide you with a link to some sort of calculator who do it?
Even your Windows Calculator even has it :D
Open the calculator, go to View -> Programmer. A list should appear on the left, select "Hex". Then you can type something like "A8". Now select "Dec" in the list and boom! The calculator tells you it's 168 (and 168 out of 255 is about 66%).

Still, other bases are extremely easy to learn. Basically because they're all pretty much the same.
Every base is converted the same way and behaves the same way. We use them because they're easier (base-10 is just pretty bad, so we need others :p).
To convert any N-digit number of any base to decimal:
an(base)n-1 + an-2(base)n-1 + ... + a2(base)1 + a1(base)0
"base" is the base number. You count in base 10 (decimal), computers in base 2 (binary) and base 16 (hexadecimal).
a0 to an are integers between 0 and (base-1).

This may look complicated, but it's really easy to use.


After a while, there should be an entire range of colours ingrained in your brain.
You learn to know that yellow is red and green,
orange is just yellow with less green.
Brown is orange with less red and green,
Teal is blue and green (though it looks better with a bit less green),
Magenta (bright pink) is red and blue,
Purple is magenta with less red,
I could go on forever, but I shan't.
 
Level 7
Joined
Sep 9, 2007
Messages
253
There are two different type of colour. The colour I learned at school says that red yellow and blue are primary while green purple and orange are secondary. This works when mixing paint but when it comes to light there are a different set of colours.

red green blue are primary while cyan magenta and yellow are the secondary colours of light. mixing colours on a computer screen relies on light and so we use the light spectrum of colours and not the same one we used for paint in kindergarten.

make sure u don't get them confused.
 
Even your Windows Calculator even has it :D
Open the calculator, go to View -> Programmer. A list should appear on the left, select "Hex". Then you can type something like "A8". Now select "Dec" in the list and boom! The calculator tells you it's 168 (and 168 out of 255 is about 66%).

Still, other bases are extremely easy to learn. Basically because they're all pretty much the same.
Every base is converted the same way and behaves the same way. We use them because they're easier (base-10 is just pretty bad, so we need others :p).
To convert any N-digit number of any base to decimal:
an(base)n-1 + an-2(base)n-1 + ... + a2(base)1 + a1(base)0
"base" is the base number. You count in base 10 (decimal), computers in base 2 (binary) and base 16 (hexadecimal).
a0 to an are integers between 0 and (base-1).

This may look complicated, but it's really easy to use.


After a while, there should be an entire range of colours ingrained in your brain.
You learn to know that yellow is red and green,
orange is just yellow with less green.
Brown is orange with less red and green,
Teal is blue and green (though it looks better with a bit less green),
Magenta (bright pink) is red and blue,
Purple is magenta with less red,
I could go on forever, but I shan't.
165*100 = 16500
16500/255 = 64
That trick with the culculator made the hexa much easier to work with , but I wanted to make sure that you know that 64.00 is not "about 65" XD
 
There are two different type of colour. The colour I learned at school says that red yellow and blue are primary while green purple and orange are secondary. This works when mixing paint but when it comes to light there are a different set of colours.

red green blue are primary while cyan magenta and yellow are the secondary colours of light. mixing colours on a computer screen relies on light and so we use the light spectrum of colours and not the same one we used for paint in kindergarten.

make sure u don't get them confused.

Don't you think we ignore such comments since the "noob" who didnt know the difference from primary color and formula of 3 colors in 0-100% ratio, named in 255 numbers which are described with letters - will simply wouldn't need all those comments? I needed to know how to form a color inside a text, what usefull will it make if you say "make sure you don't get confused in kindergarten colors" its really proves your answer not polite and wouldn't fit the asker.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I believe you're mistaken, best_player_88: his comment wasn't impolite (at least it wasn't meant to be).
In kindergarten, you start playing with paint. The colors you use there are completely different from the colors you use on your computer.
So it's not "don't get confused in kindergarten colors", it's "don't confuse colors you learnt from the time you were in kindergarten with the ones they use for screens (TV, computer, ...)" (you misinterpreted that).

As I said in my first post here: paint (including printing, which is computer-related) uses different primary colors (Cyan, Magenta, Yellow and Black). He just wanted to make that clear I think (since, there, yellow is a primary color and not a mixture of others).

165*100 = 16500
16500/255 = 64
'A8' is 168. 16800/255 is 65.88 which is "about 66%" :D.
 
I believe you're mistaken, best_player_88: his comment wasn't impolite (at least it wasn't meant to be).
In kindergarten, you start playing with paint. The colors you use there are completely different from the colors you use on your computer.
So it's not "don't get confused in kindergarten colors", it's "don't confuse colors you learnt from the time you were in kindergarten with the ones they use for screens (TV, computer, ...)" (you misinterpreted that).

As I said in my first post here: paint (including printing, which is computer-related) uses different primary colors (Cyan, Magenta, Yellow and Black). He just wanted to make that clear I think (since, there, yellow is a primary color and not a mixture of others).


'A8' is 168. 16800/255 is 65.88 which is "about 66%" :D.
His information is usefull but I just simply wanted to know how to use
% of 3 colors to create particular color, there was allready a comment
here "this is a math of first grade" which made me skip on unrelated/insulting
massages, maybe his information was usefull but it was unrelated so I
assumed it to be insulting, this information is intresting, about the light
creating 3 colors which not allways match the paint colors, my bad.
:thumbs_up:
"'A8' is 168." yes but I had the annoying comment on mymind who made me missread the original comment.
 
Level 7
Joined
Sep 9, 2007
Messages
253
this information is intresting, about the light creating 3 colors which not allways match the paint colors, my bad.

Well thanks for reconsidering. I was just trying to help.... I was always baffled at how mixing Green and Red could make Yellow because when I first learned this I could only think about how if you mix red and green paint you would get some icky brown colour.
 
Status
Not open for further replies.
Top