• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Tinting a Unit Black?

Status
Not open for further replies.
Level 5
Joined
Aug 7, 2016
Messages
55
Okay, so its been a long time since I went back into this site and this has been bugging me for like ages. Is it possible to tint a unit to a black color via trigger? or even in the Unit Editor if it's possible
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Just to nitpick, the inputs are not percents in the Objet Editor. If you change the colors in Trigger Editor, they are values between 0-100%. In the Object Editor, they are values between 0-255.
Only in GUI...
JASS:
function SetUnitVertexColorBJ takes unit whichUnit,real red,real green,real blue,real transparency returns nothing
    call SetUnitVertexColor(whichUnit, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency))
endfunction
JASS:
native SetUnitVertexColor takes unit whichUnit,integer red,integer green,integer blue,integer alpha returns nothing
As you can see, they are also in the 0 to 255 range in triggers as well. GUI even masks the fact that there are only 256 valid values per component with the illusion of a "percentage".
 
Status
Not open for further replies.
Top