Free: MCColorPanel component for Delphi 6,7
Download Demo / Source Code
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 to use with custom comboboxes as a drop-down control
(especially with
TdxPopupEdit by DevelopersExpress). Also, it can be merely dropped onto a Form.
- This component have to be installed into the Delphi Component Palette.
|
|
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;
|
|