// Draw an "F" on the foreground color, and a "B" on background color procedure TMainForm.IEColorPalette1AfterPaintCell(ACanvas: TCanvas; CellRect: TRect; aColor: TColor; Index: Integer; aState: TIEColorCellState; var aStyle: TIETransparentStyle; var Handled: Boolean); var cellChar: string; begin cellChar := ''; if aColor = fForegroundColor then cellChar := 'F' else if aColor = fBackgroundColor then cellChar := 'B';
if cellChar <> '' then begin ACanvas.Brush.Style := bsClear; ACanvas.Font.Style := [ fsBold ];
// Draw text in center of cell ACanvas.TextOut( CellRect.Left + ( CellRect.Right - CellRect.Left ) div 2 - ACanvas.TextWidth( cellChar ) div 2, CellRect.Top + ( CellRect.Bottom - CellRect.Top ) div 2 - ACanvas.TextHeight( cellChar ) div 2, cellChar ); end; end;