qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.24k stars 39.3k forks source link

Not clear on how to set custom static RGB gradient #5552

Closed capaldo closed 2 years ago

capaldo commented 5 years ago

I'm attempting to simply set the static gradient to be red, blue, green, yellow, orange and remove the pink/purple/teal/etc.

If anyone can provide some guidance because I've been at this for about 6-7 hours and cant seem which file I need to define the hues that I want to display.

drashna commented 5 years ago

You mean this?

const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};

If so, this should be able to go into your keymap.c

However, I don't think you can get rid of the colors you don't want, short of implementing your own code.

That said, try:

const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 120, 60, 39};
capaldo commented 5 years ago

Did not work unfortunately. Thank you for the help anyways.

drashna commented 5 years ago

Okay, in that case, you'd need to implement this manually, yourself.

This is the code that actually creates the effect: https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight.c#L553-L567

capaldo commented 5 years ago

Okay, in that case, you'd need to implement this manually, yourself.

This is the code that actually creates the effect: https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight.c#L553-L567

Thank you for your help. Looks like its time to learn some C!

drashna commented 5 years ago

Well, that should get you started, at least.

Basically, disable animations, and run that block of code in matrix_scan_user, and it should get you off and running.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs. For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

tzarc commented 2 years ago

Closing due to inactivity.