Garry's Mod Wiki

DProperty VectorColor

Description

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.

Parent

Derives from DProperty_Generic.

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

Page Links


Special Pages


Wikis

?

Render Time: 72ms

DB GetPage 41
Generate Html 9
SaveChanges (1) 9
Render Body 0
Render Sidebar 11