Garry's Mod Wiki

Revision Difference

DImage:SetImageColor#513620

<function name="SetImageColor" parent="DImage" type="panelfunc">⤶ <ispanel>yes</ispanel>⤶ <description>Sets the image's color override.</description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="col" type="table">The color override of the image. Uses the &lt;page&gt;Color&lt;/page&gt;.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Creates a frame with a Portal box inside and sets the color to green.</description>⤶ <code>⤶ -- Frame⤶ MainFrame = vgui.Create("DFrame")⤶ MainFrame:SetSize(200, 180)⤶ MainFrame:Center()⤶ MainFrame:SetTitle("Color example")⤶ ⤶ -- Image of a Portal box⤶ local metalbox_img = vgui.Create("DImage", MainFrame)⤶ metalbox_img:SetPos(35, 35)⤶ metalbox_img:SetSize(128, 128)⤶ metalbox_img:SetImage("spawnicons/models/props/metal_box_128.png")⤶ ⤶ metalbox_img:SetImageColor(Color(128, 255, 0, 255))⤶ </code>⤶ <output></output>⤶ ⤶ </example>