Peter Jones
Peter Jones

Reputation: 745

TAlphacolor in Integer to convert to Alphacolor description

I obtained a value of -65536 from the RTTI inspector for Red.

  1. How do I convert it into a constant description of Red without duplicating all the members of the TAlphaColorRec record into an array?

  2. How do I set ColorCombobox1.Color := ... somefunction(-65536) that TColorCombobox knows it is Red?

From Delphi source:

TAlphaColorRec = record
const
  Alpha = TAlphaColor($FF000000);
  Aliceblue = Alpha or TAlphaColor($F0F8FF);
  Antiquewhite = Alpha or TAlphaColor($FAEBD7);
  Aqua = Alpha or TAlphaColor($00FFFF);

I read How to set a custom TAlphaColor programmatically? but it does not have what I need.

Upvotes: 2

Views: 883

Answers (1)

Philip J. Rayment
Philip J. Rayment

Reputation: 1210

I think what you're looking for in question #1 is AlphaColorToString() in the System.UIConsts unit.

Upvotes: 5

Related Questions