如何在调色板和滑块上将颜色转换为(x,y)坐标

我做了一个颜色选择器,它功能齐全,可以完成应有的功能。 我想添加一个输入框,用户可以在其中插入任何颜色值HEX,RGBA,HSLA。 现在,我试图获取用户输入的值,然后将滑块和调色板中的“光标”更改为正确的位置。

This is what my color palette looks like and its values / possibly important information; and just to point out the 'cursor' im talking about is @ top right of the color palette, and slider ofcourse is the rainbow range input enter image description here

在此先感谢您的帮助。