Feature : Current colors palette

Created dynamic palette displaying currently used colors.
This palette is now selected by default.

New service UsedColorsService created. Listens to PISKEL_RESET and
TOOL_RELEASED and keeps track of the list of current colors.

Still need to :
- improve sorting of colors
- allow to clone the current color palette as a custom palette
- add proper getter in UsedColorService to get the list of current colors

Also I hardcoded a max-height for the palettes-list as I found no better
way of handling the case of palettes containing many colors.

Maybe should add a limit to the number of colors handled by this automatic
palette.
This commit is contained in:
jdescottes
2014-05-07 00:43:28 +02:00
parent f4108c7dbf
commit 637fa05109
9 changed files with 96 additions and 20 deletions

View File

@ -20,6 +20,8 @@ var Constants = {
TRANSPARENT_COLOR : 'rgba(0, 0, 0, 0)',
NO_PALETTE_ID : '__no-palette',
CURRENT_PALETTE_ID : '__current-colors',
MANAGE_PALETTE_ID : '__manage-palettes',
// Used for Spectrum input
PREFERRED_COLOR_FORMAT : 'rgb',