Make a colour darker or lighter

How could I make a colour darker or lighter? I know there are available methods for transparency but I need to create something like this:

Is there any method to increase the darkness of a colour value? The way I am currently doing it is by using a ball sprite on a black canvas and picking the colour of the pixel. However this is an issue every now and then as the ball sprite and canvas do not load correctly and crash the app. So i was hoping there is a simpler method or formula for it.

Have a look at this color picker by @Italo. It may help
(Google Groups)

Here is the aia

Edit: There is also a color picker extension :point_down:


Thank you Vaibhav.

The first one I don’t really like since it stops working and just shows a blank color after a while (on 2 phones) Its also more complicated than my current method. I am trying to see if i can implement my hex value input with the second extension.

Edit: Thank you very much but the extension is not suitable for my needs and the first method is essentially my method with extra sprites.

1 Like

What do you mean by it stops working after a while? Can you show a video of that or say exactly what happens or what you do before it stops working?

1 Like

I have deleted it now but the issue was I would quickly move my finger across the canvas and after a few seconds it would stop changing colours and the background would just turn white. with the sprite overlays.

That’s an easy solution, Just add an if condition asking if the currentx or currenty is greater than the canvas width or height and that should fix it.

If you don’t want to use sprites to create gradients, then you should come up with the math to get the intermediate colors from one color to the other and draw the lines in that color one by one.

1 Like

Or have a black canvas and draw line by line from the color at the top with transparency 255 to the last line with transparency 0.

1 Like

I have a gradient already using the gradient extension and a slider. I use a ball sprite and a black canvas and change the transparency of the ball depending on where the slider is then pick the pixel colour. I was just hoping that the second canvas wasn’t necessary and there is a formula or something or extension. Alpha value for example is nice and simple, the higher the value the more opaque it is.

Edit: Thanks to both of you though!

I actually did that on my first go round, forgot why I scrapped it.

Well, I don’t see how anyone can make this any easier than that. If that is not practical for you, ask an extension developer to make a custom one for you.

I am not complaining, I have my own color picker and was wondering if there was a formula for darkness, out of curiosity.

I don’t think it should be too hard to make a procedure to input a color and a percentage and return that color darker or lighter in that percentage. I will try later and see what I can do.


Will be interesting to see! Hex is a number after all but I havent been able to, Good Luck.

May be you are over complicating things. Forget hex for a minute. You can convert the rgb values to hex after you are done.
Doing this in rgb is way easier. That’s how I’m going to approach it too. Then the procedure will convert the 3 or 4 channels into an hex value.

Ah yeah RGB would make more sense.