How to change the inner (white) color of the icon
<i class="fa fa-exclamation-triangle"></i>
?
P.S. Applying <i class="fa fa-exclamation-triangle" style="color:red"></i>
is not an answer, as the red color applies to the outer color, not to the inner exclamation white sign itself.
The Font Awesome version is: 4.7.0.
The answer of Temani Afif is a good one! Here's another approach;
The exclamation mark of this icon is a transparent part, so a trick is to add a background behind it to have the needed coloration. Of couse, the background shouldn't cover the whole area so we need to use a gradient to cover only a part of it.
The same thing with the V4:
Also the SVG version:
UPDATE
To make the answer more generic we can also consider multiple background and radial-gradient in order to color any kind of shape. The trick is to cover with the background the transparent part without overflowing.
Here is some example of icons: