How to make MacBook Pro's keyboard backlight fade in and out?

I am on a MacBook Pro 13-inch with Big Sur installed in it. I want to know whether there is any third party app or terminal command, which transitions the keyboard backlight from 0 brightness to max brightness and vice versa gradually, like it happens in RGB keyboards.

Thank You.


Solution 1:

I have reached my goal, and have created a piece of code which makes my keyboard glow like the RGBs.

The Kbrightness file is downloaded from this site. It is stored in the same folder as the python file.

Code involved:

import os
from time import sleep

value = 0.00


def change_brightness():
    os.system(f"./kbrightness {value}")


while True:
    while value <= 1.00:
        value +=0.01
        change_brightness()
        sleep(0.01)
        if value == 0.99:
            break
    while value >= 0.00:
        value -=0.01
        change_brightness()
        sleep(0.01)
        if value == 0.01:
            break