VSCode colour picker

For certain colours the colour picker displays a black gradient when the colour picked is not black.

VSCode colour picker for the colour #fd5e5f.

For the colour #fd5e5f, the gradient is black instead of the expected red.

The paint function renders the colour gradient in the colour picker.

This code renders the colour gradient in the colour picker. Before the selected colour is rendered to the colour picker, it is first saturated.

However, the saturation turns the colour black. RGB(0, 0, 0) and HSV(360, 1, 1) are black. To circumvent this problem, I used the original colour to render to the screen instead, though at a later time, I would like to revisit the saturation function after reading up more on saturation.