Topic: Color picker

Hi,
Is it possible to have a color picker? and save the value as hex in db?
many many thanks

Re: Color picker

Hope something like this can get you started to what you are looking for.

Post's attachments

Attachment icon ColorDialog.zip 547.19 kb, 158 downloads since 2022-10-05 

brian

Re: Color picker

Many Many Thanks,
Sorry for late I was in Hospital.

One ore question, how can I convert that Hex string to TColor?

Many Many Thnaks

4 (edited by vovka3003 2022-11-15 09:38:35)

Re: Color picker

Забей на HEX, сохраняй и восстанавливай десятичное (оно же и есть TColor)

Form1.Edit1.Text := IntToStr(cDialog.Color);
Form1.Edit1.Color := StrToInt(Form1.Edit1.Text);

111

Re: Color picker

vovka3003 wrote:

Забей на HEX, сохраняй и восстанавливай десятичное (оно же и есть TColor)

Form1.Edit1.Text := IntToStr(cDialog.Color);
Form1.Edit1.Color := StrToInt(Form1.Edit1.Text);

Many Thanks but when I run this:

 TdbPanel(Main.FindComponent('Panel'+IntToStr(i))).Color := StrToInt(SQLExecute('SELECT busycolor FROM settings order by id desc'));

I Have this:

FF0000 is not a Valid Integer value

How can I solve this?

6 (edited by sparrow 2022-10-31 21:30:37)

Re: Color picker

... := StrToInt('$' + SQLExecute('SELECT busycolor FROM settings order by id desc'));