Color selector and draw in shapes

I have two suggestion, let me know your thought on it!

  1. In the the color picker in code (like:"#fff" and pressing ctrl) there should be an option to choose the output format(hex or rgb) and be able to choose an alpha value

  2. I'd just really like to have a draw function that you pass a polygon and makes the future drawing function only draw in this zone (the polygon)

2 . If the polygon is a rectangle, you can use the Image object - draw on it and then just draw on the screen again (copy the bitmap content to the screen) - scrren.drawImage.

If you want to use a different shape, you can use the PIXI library. There you can mask with the shape of another object.

  1. I absolutely agree since I always use hex color codes and pressing ctrl and changing color changes that to rgb
  2. Having an alpha channel potentiometer is a nice touch.
  3. I don't know how this would be useful if you want your drawn objects to be always inside some kind of border you can use clamp for that and even make custom clamp or maybe make function that will keep object in collision with that shape idk making something like that doesn't seem difficult.
  1. I will add that there is an option in the screen object and the Image class setBlending which can be used as a mask.

You create two Image objects - one is a mask and by setting setBlending to "multiply" and "darken" you use the bitmap mask effect.

https://microstudio.dev/community/help/how-to-implement-xor-for-a-canvas-drawing/808/ https://microstudio.io/i/Loginus/mask/

Post a reply



Validate your e-mail address to participate in the community