Garry's Mod Wiki



Color picker control for a DProperties panel. Opens a DColorCombo if the color preview is clicked.

See Editable Entities for how this is used ingame.


Derives methods, etc not listed on this page from DProperty_Generic.


DProperty_VectorColor:Setup( string prop = "VectorColor", table settings )
This is used internally - although you're able to use it you probably shouldn't. Called by a property row to setup a color selection control.
DProperty_VectorColor:SetValue( Vector color )
Sets the color value of the property.


Creates a demo VectorColor property.

local Panel = vgui.Create( "DFrame" ) Panel:SetSize( 500, 500 ) Panel:MakePopup() local props = vgui.Create( "DProperties", Panel ) props:Dock( FILL ) local colorPicker = props:CreateRow( "Color", "Select Color" ) colorPicker:Setup( "VectorColor", {} ) colorPicker:SetValue( Vector( 0.61, 0.1, 0.1 ) ) colorPicker.DataChanged = function( self, data ) MsgN( "Selected color: ", data ) end