Garry's Mod Wiki

DProperty_VectorColor

Description

This is used internally - although you're able to use it you probably shouldn't.

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.

View source

Parent

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

Methods

DProperty_VectorColor:Setup( 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.

Example

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