MasterCluster.software Contact   About
Apps for Windows Source Code SQL Server Extensions  

Color Panel component for Delphi

Download Demo with Source Code. It is FREE!

Download for Free: mcColorsDemo.zip (24KB)

Demo package includes

  • Manual in HTML file (is what you currently read);
  • Source code of the sample project, mcColorsDemo;
  • FREE — full source code of the component, mcColors.pas;

Component feature overview

  • mcColorPanel is a compact color palette panel. It is consists of 4 areas (from top to bottom):
  • The Color Test Spot, painted with currently selected color
  • Palette of Microsoft Office-like color cells
  • Color hexagon with Blackness control
  • Grayscale palette
  • Keyboard Control:
    • Select next area: Ctrl + Right Arrow
    • Select previous area: Ctrl + Left Arrow
    • Select next color cell: Right Arrow
    • Select previous color cell: Left Arrow
    • Increase Blackness: Ctrl + Down Arrow
    • Decrease Blackness: Ctrl + Up Arrow
    • Finally select color: Ctrl + Enter
  • Mouse Control:
    • Clicking cell will preview color in the Color Test Spot
    • Double clicking any cell (or single clicking the Color Test Spot) will finally select color
  • Each color cell provides a popup hint with Color Name (when present), RGB value and Hex value. The Color Test Spot only displays a Hex color value.
  • mcColorPanel completely paint itself and has no child controls. This makes it possible using it with custom comboboxes as a drop-down control (especially with TdxPopupEdit by DevelopersExpress.com). And of course, it can be simply dropped onto a Form.
  • This component have to be installed into the Delphi Component Palette.
TmcColorPanel

Component Reference

TMCColorPanel, properties

Blackness
Specifies the percentage of color blackness. From 0% (default) to 100%. Read/Write.

property Blackness: Byte;

Color
Specifies the selected color. Read/Write.

property Color: TColor;

Remarks
When the selected color is matched to more than one color cell, these cells are also highlighted. For example, set blackness to 0 and select white cell (center of the Color hexagon). At the same time component will automatically select white cell in the Office-like area and white cell in the Grayscale area.

TMCColorPanel, events

OnChange
Occurs when color cell is changed. Read/Write.

property OnChange: TNotifyEvent;

OnSelected
Occurs wnen the color is finally selected. Read/Write.

property OnSelected: TNotifyEvent;

Copyright © 2003-2017 MasterCluster.com
Share |