Download

Color Picker

Hi, I’m working in UMG and have to give the player the ability to select which colour they want their character to be. How would I go about displaying a colour picker.

I will have a coloured button (to show the default colour) and if the player clicks on it a colour picker will display and let the user pick their colour. I then need to store that value.

If anyone could help it would be appreciated.

Thank You

For lack of a color picker in UMG I made 3 sliders to do the job, 4, with alpha channel :slight_smile:

Then I have an image that is updated to match the combination of the slider values.

I then used a delegate that sends out the color to whoever is listening to the delegate and I execute the delegate (event dispatcher) whenever a slider value is changed.

I might submit a series of UMG things like this to marketplace at some point

But that’s the basics of what I personally did!

Rama

I personally would do what Rama said with the sliders. Uber simple and less likely to break lol. However if your wanting a circle type colour picker (and a challenge) you might be able to do something based off of the mouse cursors distance and angle from a mid point of a circle. The angle being the Hue and the distance being the saturation. You would then most likely need a slider anyway for the black level and the alpha.

I’ve labelled the UE4 colour picker as an example.

UE4ColourPicker.png

Hope this helps.

You could just use the editor’s color picker if you’re not picky on how it looks :slight_smile: You’ll need to wrap the creation of the SWidget inside a UWidget to use it with UMG, but that’s pretty straight forward (look at a few of the existing ones).

How can you do that? I mean how to wrap the SWidget inside a UWidget? I`m pretty new so it would be nice if you could explain how it is done:)