- Fixed an issue where
GimpPaletteSerializer.Deserialize
could get itself stuck in an infinite loop if a GPL file was formatted a certain way GimpPaletteSerializer.Serialize
now usesASCII
encoding instead ofUTF-8
, fixing a problem where palette files couldn't be opened in Inkscape.
- Added new
AdobePhotoShopColorSwatchSerializer
serializer for reading and writing Adobe PhotoShop colour swatches (both version 1 and version 2) - You can now set the
Columns
property of aColorGrid
control to0
, which will then internally calculate columns based on the size of the control, the cell size, and the spacing. A new read-onlyActualColumns
property has been added which will allow you to get the real number of columns if required. TheAutoSize
behaviour has been changed so that only the vertical height of the control is adjusted whenColumns
is zero - Save Palette button in the
ColorPickerDialog
now obtains the serializer to use based on the selected filter index, allowing correct saving if multiple serializers use the same extension. - Added
CanReadFrom
method toIPaletteSerializer
. PaletteSerializer.GetSerializer
now makes use of the above new method to access the relevant serializer rather than just matching extensions. This means if you have two serializers that support different .pal formatted files, these can now be loaded successfully, instead of one loading and one failing.- Added new
RawPaletteSerializer
which reads and writes palettes that are simply RGB triplets in byte form - Added new
ShowAlphaChannel
property toColorEditor
andColorPickerDialog
. This property allows the alpha channel editing controls to be hidden, for when working with 8-bit colours. - The rendering of the selected cell in a
ColorGrid
control who'sSelectedCellStyle
isZoomed
now usesPadding.Left
andPadding.Top
to determine the size of the zoom box, avoiding massive boxes the larger theCellSize
gets. - Added a new standard 256 colour palette. You can use this in the
ColorGrid
by setting thePalette
property toColorPalette.Standard256
or obtain the array of colours by callingColorPalettes.StandardPalette
ColorGrid
andRgbaColorSlider
controls now only create transparency brushes when required. A new virtual methodSupportsTransparentBackColor
allows inheritors to create their own brushes if required.- Added
EditingColor
event toColorGrid
, allowing the edit colour action to be cancelled, or replaced with a custom editor - Added
CurrentCell
property andGetCellOffset
methods to theColorGrid
. ColorCollection
now implementsIEquatable
- Added more tests
- Added new
Navigate
method toColorGrid
for easier moving within the cells of the grid
- The
ColorGrid
control now tries to be smarter with painting, and only paints cells that intersect with the clip rectangle. In addition, where possible only individual cells are invalidated rather than the entire control. - Corrected invalid error messages from the Save Palette button in the
ColorPickerDialog
. - Load Palette and Save Palette buttons in the
ColorPickerDialog
now check theCanRead
andCanWrite
properties of the serializer. - Double clicking with any button other than the left in
ColorGrid
control no longer attempts to initiate colour editing - Setting the
Color
property of theColorGrid
control toColor.Empty
no longer treats the value as a valid colour - The
ColorGrid
control no longer defines custom colour regions when theShowCustomColors
property wasfalse
. This manifested in hover and selection effects working if you moved your mouse over the bottom of a resized grid. - Clicking "white space" areas of a
ColorWheel
control will no longer incorrectly set the colour to the closest matching point on the wheel itself. However, starting to select a colour within the wheel and then moving outside the bounds will continue to select the closest match as usual. - Fixed a crash that occurred when creating controls that inherited from
ColorGrid
orRgbaColorSlider
- When the
AutoAddColors
andShowCustomColors
properties arefalse
, unmatched colours will no longer be silently added to theColorGrid
custom palette unexpectedly. This also resolves various crashes after the colour regions fix above was applied. - The
ColorWheel
control now makes use ofButtonRenderer.DrawParentBackground
to draw itself, to avoid ugly blocks of solid colours when hosted in containers such as theTabControl
- The
ColorEditorManager
control'sColorChanged
event has now been marked as the default event, so when you double click the component in the designer, a code window now correctly opens. - If the underlying entry in a
ColorCollection
bound to aColorGrid
control was modified, and this particular entry was the selected colour, theColorGrid
would not keep itsColor
property in sync and would clear the selected index. - Attempting to set the
Columns
property to less than zero now throws anArgumentOutOfRange
exception rather than setting it, then crashing later on - Double clicking a colour in the grid of the
ColorPickerDialog
no longer opens another copy of theColorPickerDialog
- Fixed problems in the
ColorGrid
with keyboard navigation and initial focus if no valid colour index was set. - The
ColorCollection.Find
method now correctly works when adding named colours (e.g.Color.CornflowerBlue
) to the collection, but searching by ARGB value (e.g.Color.FromArgb(100, 149, 237)
) - Fixed an issue where if the internal dictionary lookup in
ColorCollection
class had been created and the collection was then updated, in some cases the lookup wasn't correctly modified.
- Added
Find
method toColorCollection
- Replaced
ColorComparer.Brightness
with version derived from here - Added new
InterleavedBitmapPaletteSerializer
class, that allows palettes to be loaded from ILBM (IFF Interleaved Bitmap) format files (LBM images or BBM palettes). Note: Writing is not yet supported. - Added
CanRead
andCanWrite
properties toIPaletteSerializer
to indicate input/output support. - The
PaletteSerializer.DefaultOpenFilter
andPaletteSerializer.DefaultSaveFilter
make use of the above properties when building filters - Added the ability for multiple extensions to be supplied.
- The colours displayed in the drop down list component of the
ColorEditor
now only load when the drop down is opened, or the Up, Down, Page Up or Page Down keys are pressed - Reworked the
ColorEditor
control to work nicer with RGB colours. Previously, theColor
property was a wrapper around theHslColor
property, meaning if you set it to a named colour such asColor.Red
, the name was lost, and the hex/name editor didn't show the name. Now it keeps track of both colours, so if you set it to a named value, you can see (and get) the named value back. - Reworked the
ColorEditorManager
component to also store separate copies of the RGB/HSL colours instead of loosing named colour information - Experimented with making the
hex/named colour
field in theColorEditor
control slightly wider than the other controls. Looks a touch odd now that all fields aren't a uniform width, but does make it much easier to read that the selected colour isLightGoldenRodYellow
!
- Setting the
SelectionSize
property of theColorWheel
didn't resize the wheel as it was supposed to - When the orientation of a
ColorSlider
(or derived control) wasVertical
, the colour bar was drawn in the reverse order of the scale. - Changing the
Value
of theLightnessColorSlider
control now correctly updates theColor
property of that control, in turn making theColorEditorManager
change the luminosity of linked controls. Also setting theColor
of theLightnessColorSlider
now correctly updates theValue
. This now means you can bind aColorWheel
to aLightnessColorSlider
for full control over the brightness of a colour, which is not possible to do with the wheel alone.
- Added static
LoadPalette
and instanceLoad
methods toColorCollection
- Added
Save
method toColorCollection
- Added new constructor to
ColorCollection
that accepts aSystem.Drawing.Imaging.ColorPalette
class. - Added new
AutoFit
property to theColorGrid
. When set, theCellSize
property is automatically calculated based on the size of the control, and its contents. You can't combineAutoFit
withAutoSize
. ColorCollection
is now clone-able
- Removed unnecessary
UpdateStyles
calls. - Fixed a problem if a window was opened by pressing
Enter
, and aColorGrid
was the first focusable control on the new window, the pop-up colour editing dialog would be activated, regardless of theColorGrid
's editing settings
- Added
Name
andDefaultExtension
properties toIPaletteSerializer
- Added new static properties
DefaultOpenFilter
andDefaultSaveFilter
, and static methodGetSerializer
toPaletteSerializer
. These allow the use of reflection for easily providing palette load and save functionality automatically based on loaded assemblies. - Added the
SupportsTransparentBackColor
control style toColorGrid
- Added system colours to the
ColorEditor
named colour drop down - Added a new
DoubleSoft
cell border style to theColorGrid
- Setting the
Spacing
orCellSize
properties of theColorGrid
control didn't recalculate the layout ColorEditor
now usesTextRenderer.DrawText
instead ofGraphics.DrawString
so all text is rendered consistently.
- Added new constructor to the
ColorCollection
class that accepts anIEnumerable<int>
ColorCollection
now implementsIClonable
- Added dotted outline to design time
ColorGrid
control
- Fixed invalid default value for the
EditMode
property of aColorGrid
- Fixed
AutoSize
property ofColorGrid
control not being persisted
Note: Several of the updates in this version are breaking changes due to renaming of classes and enum values. Some more changes to your code will be required to use the new Color Picker API.
IPaletteReader
replaced withIPaletteSerializer
JascPaletteReader
replaced withJascPaletteSerializer
GimpPaletteReader
replaced withGimpPaletteSerializer
PaintNetPaletteReader
replaced withPaintNetPaletteSerializer
- The values of the
ColorEditingMode
enum have been renamed to make more sense. - The
ColorEditor
now supports selecting of named colours as the hex editor is now a drop down list. As well as being able to select named colours from the list, you can now also type names directly into the hex editor and they will be processed accordingly. - The
ColorPickerDialog
now can load and save palette files - Palette support has been reworked to allow the saving of palettes as well as loading. Unfortunately due to the initial names of these classes this is a breaking change.
- Added a bit more documentation
- Corrected some grammatical errors in existing documentation and headers
Note: Several of the updates in this version are breaking changes due to renaming of classes and enum values. Some more changes to your code will be required to use the new Color Picker API.
- Added
GimpPaletteReader
for reading palette files created by Gimp - Added
ReadPalette(fileName)
overload toIPaletteReader
- Renamed
Jasc10PaletteReader
toJascPaletteReader
- Reworked Jasc palette import to match how Gimp is doing it
- Added a testing project. Currently this just tests the different palette readers are importing data correctly.
- Initial Release