This change is more a "button behavioral" change than technical. The rationale is that the "Add" button should add colors to the bar only after the colors are already defined, and the "Palette" button should define the primary or secondary color based on the selected color.
Currently, the "Add" button triggers some code execution even if there is no previously selected color, exhibiting the undesired behavior listed on this bug.
Hello Jacob and an folks reviewing this code,
This change is more a "button behavioral" change than technical. The rationale is that the "Add" button should add colors to the bar only after the colors are already defined, and the "Palette" button should define the primary or secondary color based on the selected color.
Currently, the "Add" button triggers some code execution even if there is no previously selected color, exhibiting the undesired behavior listed on this bug.
One solution is to remove this button as suggested in my previous commenthttps://github.com/jb-tlm/color-charter/issues/22#issuecomment-1639080919 because case #13 added the ability to click on any color to add it to the Color Bar.
The proposed solution is to allow the "Add" button to work only after selecting a color with the "Palette" button.
Please, let me know if you prefer to remove the button or otherwise by accepting this PR will conditionally enable the button.