Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Component Colour

Posted on 1999-06-27
Medium Priority
129 Views
Is there any way to give a component a color other than the available choices. Maybe use hexadecimal?

Cheers
xpher
0
Question by:xpher
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 3

LVL 17

Accepted Solution

inthe earned 80 total points
ID: 1384824
hi
yes you can do this like so:

procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.color:=\$00E8FCFF;  {a yellowish color}
end;

is that what you were after?
Regards Barry
0

LVL 17

Expert Comment

ID: 1384825
btw
if you need a list of hex colors ,i got mine from a website for teaching html which as you probably know uses hex for the colors.maybe you have a list in a html book...
i could probably find you a list if you need ,just say if so..

Barry
0

LVL 1

Author Comment

ID: 1384826
Many thanks (again) Barry. Yes I have got a list of colours.

Cheers
Chris :))
0

LVL 1

Author Comment

ID: 1384827
Hi
A problem. The color with hexadecimal #A50000 is supposed to be a deep red. If I use \$A50000 it is blue (a very nice blue but not red). Any ideas?

Cheers
Chris :)(
0

LVL 17

Expert Comment

ID: 1384828
LOL,Yes i just tried that and is very blue :-)

the answer seems to be everything is backwards.
ie:
procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.color:=\$0000A5; {this = deep red}{nice color btw}
end;

it goes \$(hex)00(blue)00(green)00(red)
so ff0000 is blue not red as should be..
strange huh :-)
Regards Barry
0

LVL 1

Author Comment

ID: 1384829
Many thanks Barry (again)(again).

Cheers
Chris:))
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…