Skip to content

Latest commit

 

History

History
492 lines (413 loc) · 19.2 KB

CHANGELOG.md

File metadata and controls

492 lines (413 loc) · 19.2 KB

Cyotek Color Picker Controls for Windows Forms

Change Log

2.0.0 (WIP)

Added

  • Added Lightness property to the ColorWheel control, used to set the lightness of the generated color and to avoid resetting of lightness when using the ColorEditorManager
  • Added Alpha property to the ColorWheel control, used to set the alpha channel of the generated color and to avoid resetting of alpha when using the ColorEditorManager
  • Added DisplayLightness property to the ColorWheel control. When set, the wheel is drawn using the specified lightness, otherwise it draws the wheel at 50% (default)
  • Added ShowSaturationRing, ShowCenterLines, LineColor, ShowAngleArrow, SecondaryColors and SecondarySelectionSize properties to the ColorWheel control
  • Added ScreenColorPicker.CaptureMouse and ReleaseMouse methods. These allow you to initiate a screen picker operation without having to click and drag in the source control, for example via hotkey
  • Added ScreenColorPicker.Selecting and Selected events, allowing you to know when a selection operation starts and ends
  • Added ColorSlider.NubOutlineColor
  • Added PreserveAlphaChannel, ShowLoad, ShowSave and CustomColors properties to the ColorPickerDialog component
  • Added CustomColorsLoading and CustomColorsSaving events to the ColorPickerDialog component
  • Added ColorEditor.PreserveAlphaChannel. By default, the ColorEditor will strip the alpha component from a colour if the ShowAlphaChannel property is not set. This new property allows the component to be preserved
  • Added ColorEditor.ShowHex, ShowHsl and ShowRgb properties for showing or hiding groups of editors
  • Added the ColorEditor.NubSize, NubColor and NubOutlineColor to allow at least some customisation of the sliders

Changed

  • Added dedicated targets for .NET 3.5, .NET 4.0, .NET 4.5.2, .NET 4.6.2,.NET 4.7.2, .NET 4.8, .NET 5.0 and .NET Core 3.1
  • Focus rectangles in slider controls now use an inverse painting operation
  • Drag handles in the slider controls are no longer fully outside the bar, but are half inside and half out
  • The Up, Down, Home and End keys are now used to manipulate the saturation value when a ColorWheel control has focus

Deprecated

  • The IPaletteSerializer and IColorEditor interfaces have been marked as obsolete
  • The PaletteSerializer, AdobeColorTablePaletteSerializer, AdobePhotoShopColorSwatchSerializer, GimpPaletteSerializer, InterleavedBitmapPaletteSerializer, JascPaletteSerializer, PaintNetPaletteSerializer, and RawPaletteSerializer classes have been marked as obsolete
  • The AdobePhotoshopColorSwatchColorSpace and AdobePhotoshopColorSwatchFileVersion enums have been marked as obsolete

Removed

  • The method ColorEditor.ResizeComponents is no longer accessible

Fixed

  • The method HslColor.ToRgbColor didn't convert colours properly, most visible in the LightnessColorSlider which always showed a black and white scale no matter what the base color was
  • Changing the LightnessColorSlider.Value property no longer updates the Color property
  • The ColorManagerEditor does a better job of syncing values between attached controls
  • The SaturationColorSlider and LightnessColorSlider controls now display a checker box background for non-solid colours
  • The ColorGrid control wasn't binding events for the default Colors and CustomColors property values, causing programmatic changes not to be reflected in the control or crashes trying to access values not present
  • Calling ColorGrid.EndUpdate didn't perform layout operations if the total number of colours had changed whiles updating was disabled

1.8.0

Changed

  • The ColorGrid control now will now automatically scale color cells if the application is displayed with high DPI

Deprecated

  • The protected SelectionGlyph, Points, LockUpdates and Colors properties of the ColorWheel control are deprecated and will be removed in a subsequent update

Fixed

  • The ColorWheel no longer automatically snaps to the center of the wheel when the mouse is approaching the center

1.7.2

Added

  • Added new ShowColorSpaceLabels property to the ColorEditor control. When false, the RGB and HSL labels will be hidden, allowing the control to take up less space. The default value is true
  • Added new CellContextMenuStrip property to the ColorGrid control, allowing ContextMenuStrip controls to be automatically displayed when context clicking (including keyboard hotkeys) color cells
  • Added new GetCellBounds method to the ColorGrid control, allowing consumers to get the Rectangle bounds of a color cell for purposes such as displaying context menus separately from the above support

Changed

  • Reworked ColorEditor reszing handling so it doesn't look quite as awful if the control is small

1.7.1

Fixed

  • Palette property of the ColorGrid control wasn't initialized correctly, making it pretty difficult to have a blank palette

1.7.0

Added

  • Merged non-destructive changes from the version 2 branch, mainly around reworking events to require less overhead

1.6.0

Added

  • Added Minimum and Maximum properties to IPaletteSerializer to provide hints to hosting applications about valid palettes
  • Added support for reading and writing Adobe Color Table files (*.act) via the new AdobeColorTablePaletteSerializer class

Changed

  • Code refactored using C# 6 syntax

Fixed

  • Fixed rounding errors that could occur when using HslColor.ToRgbColor. Thanks to Jürgen from Iconshow for this post
  • Attempting to set the Colors property of the ColorGrid to null now throws an exception

1.5.0

  • Added a new demonstration which shows how to host a ColorGrid control in a ToolStrip. More details on this can be found on cyotek.com.
  • Added new PreviewColorChanged event to the ColorPickerDialog
  • Added new PaintColor protected methods to the ColorWheel control allowing additional hotspots to be painted
  • Added new constructor to the ColorCollection to copy the contents of another ColorCollection
  • The ColorGrid control now to defaults to creating 16 custom colours instead of 32
  • Fixed an issue where the ColorGrid control wasn't rendering the custom colours group correctly (regression from previous version). Thanks to Michael Schwarz for pointing out the offending line of code
  • Fixed an issue where the ColorPickerDialog displayed non-opaque colours when the ShowAlphaChannel property was false
  • Fixed an issue where the ColorEditor control would allow you to enter an 8 character hex color and thus set an alpha channel even if the ShowAlphaChannel property was false

1.4.1

Fixed

  • 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 uses ASCII encoding instead of UTF-8, fixing a problem where palette files couldn't be opened in Inkscape.

1.4.0

Changes and new features

  • 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 a ColorGrid control to 0, which will then internally calculate columns based on the size of the control, the cell size, and the spacing. A new read-only ActualColumns property has been added which will allow you to get the real number of columns if required. The AutoSize behaviour has been changed so that only the vertical height of the control is adjusted when Columns 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 to IPaletteSerializer.
  • 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 to ColorEditor and ColorPickerDialog. 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's SelectedCellStyle is Zoomed now uses Padding.Left and Padding.Top to determine the size of the zoom box, avoiding massive boxes the larger the CellSize gets.
  • Added a new standard 256 colour palette. You can use this in the ColorGrid by setting the Palette property to ColorPalette.Standard256 or obtain the array of colours by calling ColorPalettes.StandardPalette
  • ColorGrid and RgbaColorSlider controls now only create transparency brushes when required. A new virtual method SupportsTransparentBackColor allows inheritors to create their own brushes if required.
  • Added EditingColor event to ColorGrid, allowing the edit colour action to be cancelled, or replaced with a custom editor
  • Added CurrentCell property and GetCellOffset methods to the ColorGrid.
  • ColorCollection now implements IEquatable
  • Added more tests
  • Added new Navigate method to ColorGrid for easier moving within the cells of the grid

Fixed

  • 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 the CanRead and CanWrite 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 the ColorGrid control to Color.Empty no longer treats the value as a valid colour
  • The ColorGrid control no longer defines custom colour regions when the ShowCustomColors property was false. 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 or RgbaColorSlider
  • When the AutoAddColors and ShowCustomColors properties are false, unmatched colours will no longer be silently added to the ColorGrid custom palette unexpectedly. This also resolves various crashes after the colour regions fix above was applied.
  • The ColorWheel control now makes use of ButtonRenderer.DrawParentBackground to draw itself, to avoid ugly blocks of solid colours when hosted in containers such as the TabControl
  • The ColorEditorManager control's ColorChanged 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 a ColorGrid control was modified, and this particular entry was the selected colour, the ColorGrid would not keep its Color property in sync and would clear the selected index.
  • Attempting to set the Columns property to less than zero now throws an ArgumentOutOfRange 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 the ColorPickerDialog
  • 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.

1.3.0

Changes and new features

  • Added Find method to ColorCollection
  • 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 and CanWrite properties to IPaletteSerializer to indicate input/output support.
  • The PaletteSerializer.DefaultOpenFilter and PaletteSerializer.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, the Color property was a wrapper around the HslColor property, meaning if you set it to a named colour such as Color.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 the ColorEditor 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 is LightGoldenRodYellow!

Fixed

  • Setting the SelectionSize property of the ColorWheel didn't resize the wheel as it was supposed to
  • When the orientation of a ColorSlider (or derived control) was Vertical, the colour bar was drawn in the reverse order of the scale.
  • Changing the Value of the LightnessColorSlider control now correctly updates the Color property of that control, in turn making the ColorEditorManager change the luminosity of linked controls. Also setting the Color of the LightnessColorSlider now correctly updates the Value. This now means you can bind a ColorWheel to a LightnessColorSlider for full control over the brightness of a colour, which is not possible to do with the wheel alone.

1.2.3

Changes and new features

  • Added static LoadPalette and instance Load methods to ColorCollection
  • Added Save method to ColorCollection
  • Added new constructor to ColorCollection that accepts a System.Drawing.Imaging.ColorPalette class.
  • Added new AutoFit property to the ColorGrid. When set, the CellSize property is automatically calculated based on the size of the control, and its contents. You can't combine AutoFit with AutoSize.
  • ColorCollection is now clone-able

Fixed

  • Removed unnecessary UpdateStyles calls.
  • Fixed a problem if a window was opened by pressing Enter, and a ColorGrid was the first focusable control on the new window, the pop-up colour editing dialog would be activated, regardless of the ColorGrid's editing settings

1.2.2

Changes and new features

  • Added Name and DefaultExtension properties to IPaletteSerializer
  • Added new static properties DefaultOpenFilter and DefaultSaveFilter, and static method GetSerializer to PaletteSerializer. These allow the use of reflection for easily providing palette load and save functionality automatically based on loaded assemblies.
  • Added the SupportsTransparentBackColor control style to ColorGrid
  • Added system colours to the ColorEditor named colour drop down
  • Added a new DoubleSoft cell border style to the ColorGrid

Fixed

  • Setting the Spacing or CellSize properties of the ColorGrid control didn't recalculate the layout
  • ColorEditor now uses TextRenderer.DrawText instead of Graphics.DrawString so all text is rendered consistently.

1.2.1

Changes and new features

  • Added new constructor to the ColorCollection class that accepts an IEnumerable<int>
  • ColorCollection now implements IClonable
  • Added dotted outline to design time ColorGrid control

Fixed

  • Fixed invalid default value for the EditMode property of a ColorGrid
  • Fixed AutoSize property of ColorGrid control not being persisted

1.2.0

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.

Changes and new features

  • IPaletteReader replaced with IPaletteSerializer
  • JascPaletteReader replaced with JascPaletteSerializer
  • GimpPaletteReader replaced with GimpPaletteSerializer
  • PaintNetPaletteReader replaced with PaintNetPaletteSerializer
  • 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

Fixed

  • Corrected some grammatical errors in existing documentation and headers

1.1.0

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.

Changes and new features

  • Added GimpPaletteReader for reading palette files created by Gimp
  • Added ReadPalette(fileName) overload to IPaletteReader
  • Renamed Jasc10PaletteReader to JascPaletteReader
  • 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.

1.0.0

  • Initial Release