Ky-040 rotary encoder

Hello guys ! Newbie here , I’m trying to learn from tutorials and guides . My question is, the ky-40 that I bought, can I use it as a normal potentiometer to increase or decrease the brightness of my rgb ?? It has also a switch that I would like to use to change leds effects …
This is the part.

That part is a rotary encoder, NOT a potentiometer. By itself, it CANNOT replace a potentiometer. In combination with an Arduino, you may be able to control the brightness of an "rgb", whatever THAT is.

You can use an encoder library to keep track of "counts" from the encoder and apply the numbers (0 to 255) to an analog output pin to control the LED brightness.
Here's one such library: