Garry's Mod Wiki

Revision Difference

DColorPalette:OnValueChanged#562318

<function name="OnValueChanged" parent="DColorPalette" type="panelhook"> <description>Called when the color is changed after clicking a new value.</description>⤶ <description>Called when the color is changed after clicking a new value. For Override</description>⤶ <realm>Client and Menu</realm> <file line="228-L230">lua/vgui/dcolorpalette.lua</file>⤶ <args> <arg name="newcol" type="table">The new color of the <page>DColorPalette</page></arg> </args> </function> <example> <description>Creates a DFrame with a color palette that prints values after being changed.</description> <code> local frame = vgui.Create( "DFrame" ) frame:SetSize( ScrW() - 100, ScrH() - 100 ) frame:Center() frame:MakePopup() local palette = vgui.Create( "DColorPalette", frame ) palette:Dock( FILL ) function palette:OnValueChanged( newcol ) PrintTable( newcol ) end </code> <output>The color chosen on the palette.</output> </example>