The color type allows users to select a color using a variety of methods, including lists of web-safe colors, CMYK Sliders, picking from a spectrum of colors, and even selection by colored pencil. Consider the following example:
$form['color'] = array(
'#type' => 'color',
'#title' => $this->t('Value'),
);

Color type