@@ -62,6 +62,21 @@ function Customize(props) {
6262 "#cab2d6" ,
6363 ] ;
6464
65+ const colorBlindColors = [
66+ "#9f0162" ,
67+ "#8400cd" ,
68+ "#a40122" ,
69+ "#009f81" ,
70+ "#008df9" ,
71+ "#e20134" ,
72+ "#ff5aaf" ,
73+ "#00c2f9" ,
74+ "#ff6e3a" ,
75+ "#00fccf" ,
76+ "#ffb2fd" ,
77+ "#ffc33b" ,
78+ ] ;
79+
6580 const settingsJson = useMemo ( ( ) => {
6681 return JSON . stringify (
6782 {
@@ -180,6 +195,18 @@ function Customize(props) {
180195 setPalette ( [ ...palette , selectedColor ] ) ;
181196 } ;
182197
198+ const selectDefaultPalette = ( ) => {
199+ setPalette ( [ ...presetColors ] ) ;
200+ } ;
201+
202+ const selectColorBlindPalette = ( ) => {
203+ setPalette ( [ ...colorBlindColors ] ) ;
204+ } ;
205+
206+ const clearPalette = ( ) => {
207+ setPalette ( [ ] ) ;
208+ } ;
209+
183210 const removeColor = ( index ) => {
184211 const newPalette = [ ...palette ] ;
185212 newPalette . splice ( index , 1 ) ;
@@ -397,9 +424,32 @@ function Customize(props) {
397424 </ button >
398425 ) ) }
399426 </ div >
400- < button className = "button is-small apButton" onClick = { addColor } >
401- Add Colour
402- </ button >
427+ < div className = "buttons" >
428+ < button
429+ className = "button is-small apButton"
430+ onClick = { addColor }
431+ >
432+ Add Colour
433+ </ button >
434+ < button
435+ className = "button is-small apButton"
436+ onClick = { selectDefaultPalette }
437+ >
438+ Select default colours
439+ </ button >
440+ < button
441+ className = "button is-small apButton"
442+ onClick = { selectColorBlindPalette }
443+ >
444+ Select colour blind colours
445+ </ button >
446+ < button
447+ className = "button is-small apButtonNeutral"
448+ onClick = { clearPalette }
449+ >
450+ Clear colours
451+ </ button >
452+ </ div >
403453 </ div >
404454 </ div >
405455 < div className = "tags" >
0 commit comments