In this example:
Tip: after creating a project, add the tcolorbox, tcolorlistbox, tcolorgrid, and tbuttoncolor controls, double-click them to create default events, and paste them below. Code :
unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, colorgrd, stdctrls, tecanvas, extctrls; type tform1 = Class (tform) colorbox1: tcolorbox; colorlistbox1: tcolorlistbox; colorgrid1: tcolorgrid; gradient: gradient; Procedure gradient (Sender: tobject); Procedure colorbox1change (Sender: tobject ); procedure colorgrid1change (Sender: tobject); Procedure buttoncolor1click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.colorlistbox1click (Sender: tobject); Begin self. color: = colorlistbox1.selected; end; Procedure tform1.colorbox1change (Sender: tobject); Begin self. color: = colorbox1.selected; end; Procedure tform1.colorgrid1change (Sender: tobject); Begin self. color: = colorgrid1.foregroundcolor; end; Procedure tform1.buttoncolor1click (Sender: tobject); Begin self. color: = buttoncolor1.symbolcolor; end.