...

/

Creating a ColorPicker Dialog

Creating a ColorPicker Dialog

We'll cover the following...

Military units usually have some kind of a logo or way to visually identify themselves. Right now, our fictional Battletech units only store a name and a faction affiliation. Let’s add a field for a color as well.

If we’re going to have a color field, we need some way to actually let the user pick the color. And obviously, if we’re going to have a color picker, it should go in a modal dialog! :) (See previous comments about deliberate over-engineering.)

We’ll need to build an input to show what the current color is and trigger the color picker dialog, as well as the dialog itself.

We’ve already got the ability to show a modal, so we only need to create a new modal component class that renders some kind of color picker component. We’ll use the React-Color library, which provides a ...