I added onto your Color Picker GUI and added a custom input and added a second bar below the rainbow bar to make the color darker. I also made the GUI rounded.
Update : I added a little bit of white behind the pink on the top bar
When you change the color of the top bar, it changes the UIGradient color of the bottom bar like this:
How can I make it so that I can select different shades of white? At first it is there on the bottom, but once I drag the slider on top, there is no way of getting the white to black gradient on the bottom. I hope it make sense
Is there any plans to have this Color Picker support selecting like a very light color?
It seems if the second ‘satuation’ bar could go to ‘white’ would help selecting a more accurate color between white, light blue, blue, darkblue, black.
Edit: Seems like it was easy to manually support this by adding another color into the Bottom ColorSequence.
Line 52, ColorPickerLocalTop
local Color = ColorSequence.new{
ColorSequenceKeypoint.new(0,Color3.fromRGB(255,255,255)),
ColorSequenceKeypoint.new(0.5,getColor(xPos,ColorKeyPoints)),
ColorSequenceKeypoint.new(1,Color3.fromRGB(0,0,0))
}
Edit: Noticed you needed to use ColorSequenceKeypoint to define where to set the colors.
If you are interested, at dat.GUI I have implemented a Color Picker and the source code is available on github. At the moment it does not work on mobile (it was not the initial goal of the lib), but it can be useful for the evolution of your component, which is getting very nice.
You could. Just make it get the background color of the slider. Then make it change the lightsaber’s color to whatever the background color of the slider is. Every time it changes using the .Changed event.
Something to note is that the slider doesn’t contain any colors that
a. you haven’t added
or b. aren’t obtainable by tweening between the colors you’ve added
So you have to ask yourself:
What if you had a color picker like this, and you tried to set the color red?
The answer is that you can’t.
The method I’ve included in this post works by cutting the color bar into 510 sections and selecting the section that is closest to the color you’ve asked for. If the color you’re trying to set doesn’t exist on the bar, it’ll select whatever’s closest in terms of RGB. Also, the set color won’t be precise. It might be off by a marginal percent.
(It might not be a good idea to spam the setToClosestColor function, but computers are reasonably fast at things like this, so you should be fine.)
TLDR:
If the color doesn’t exist on the bar, it’ll set it to the closest thing
The set color will likely be marginally off, but players shouldn’t notice a difference
It’s not recommended to spam the setToClosestColor function
There might be a more mathematical/efficient way to do this, but this should be fine