SetUnitVertexColor

Parameters
whichUnit unit

The unit to modify.

red integer

visibility of red channel (clamped to 0-255).

green integer

visibility of green channel (clamped to 0-255).

blue integer

visibility of blue channel (clamped to 0-255).

alpha integer

opacity (clamped to 0-255). A value of 255 is total opacity (fully visible). A value of 0 is total transparency; the model will be invisible, but you'll still see the shadow, HP bar etc.

comment

Sets the unit's entire main model color to the color defined by (red, green, blue, alpha).

The vertex color changes how the model is rendered. For example, setting all r,g,b=0 will make the model entirely black; no colors will be visible (like Illidan's demon form).

To imagine the final result of changing vertex colors, it is helpful to think of individual RGB layers in a color image, if you disable the Red channel, only Green & Blue channels will be shown.

note

Also changes the colors of attached custom special effects.

bug

Tested 1.36.2 SD: If the unit has some secondary models/animations, these are not affected. E.g. the skulls surrounding Blood Mage are fully visible despite low alpha setting:

bloodmage = CreateUnit(Player(0), FourCC("Hblm"), 0,0, 0)
SetUnitVertexColor(bloodmage, 255, 255, 255, 32)
note

See: Similar to how BlzSetSpecialEffectColor works.

note

Not to be confused with SetUnitColor which changes a unit's player accent (tinting) color.

patch

1.00

Source
common.j
return type
nothing
Source code
native          SetUnitVertexColor  takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing