diff options
| author | Ryan <fauxpark@gmail.com> | 2021-06-30 04:15:58 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-29 19:15:58 +0100 |
| commit | 653082235aaca8552078e62714eab30d1a517f57 (patch) | |
| tree | 437d57b46aab15955b20e230e838e2ba630f1512 | |
| parent | 1e2378fe7f50d6e9d7dcd5f14e768b6718caec80 (diff) | |
| download | qmk_firmware-653082235aaca8552078e62714eab30d1a517f57.tar.gz qmk_firmware-653082235aaca8552078e62714eab30d1a517f57.zip | |
Relocate RGB/HSV color defs to a more fitting place (#13377)
| -rw-r--r-- | docs/feature_rgb_matrix.md | 45 | ||||
| -rw-r--r-- | docs/feature_rgblight.md | 43 | ||||
| -rw-r--r-- | quantum/color.h | 54 | ||||
| -rw-r--r-- | quantum/rgblight/rgblight_list.h (renamed from quantum/rgblight_list.h) | 46 |
4 files changed, 101 insertions, 87 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 925c9de6e..4bd8e1eb9 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -554,28 +554,29 @@ For inspiration and examples, check out the built-in effects under `quantum/rgb_ | |||
| 554 | 554 | ||
| 555 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. | 555 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. |
| 556 | 556 | ||
| 557 | |RGB |HSV | | 557 | |RGB |HSV | |
| 558 | |-------------------|-------------------| | 558 | |---------------------|---------------------| |
| 559 | |`RGB_WHITE` |`HSV_WHITE` | | 559 | |`RGB_AZURE` |`HSV_AZURE` | |
| 560 | |`RGB_RED` |`HSV_RED` | | 560 | |`RGB_BLACK`/`RGB_OFF`|`HSV_BLACK`/`HSV_OFF`| |
| 561 | |`RGB_CORAL` |`HSV_CORAL` | | 561 | |`RGB_BLUE` |`HSV_BLUE` | |
| 562 | |`RGB_ORANGE` |`HSV_ORANGE` | | 562 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | |
| 563 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | | 563 | |`RGB_CORAL` |`HSV_CORAL` | |
| 564 | |`RGB_GOLD` |`HSV_GOLD` | | 564 | |`RGB_CYAN` |`HSV_CYAN` | |
| 565 | |`RGB_YELLOW` |`HSV_YELLOW` | | 565 | |`RGB_GOLD` |`HSV_GOLD` | |
| 566 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | | 566 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | |
| 567 | |`RGB_GREEN` |`HSV_GREEN` | | 567 | |`RGB_GREEN` |`HSV_GREEN` | |
| 568 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | | 568 | |`RGB_MAGENTA` |`HSV_MAGENTA` | |
| 569 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | | 569 | |`RGB_ORANGE` |`HSV_ORANGE` | |
| 570 | |`RGB_TEAL` |`HSV_TEAL` | | 570 | |`RGB_PINK` |`HSV_PINK` | |
| 571 | |`RGB_CYAN` |`HSV_CYAN` | | 571 | |`RGB_PURPLE` |`HSV_PURPLE` | |
| 572 | |`RGB_AZURE` |`HSV_AZURE` | | 572 | |`RGB_RED` |`HSV_RED` | |
| 573 | |`RGB_BLUE` |`HSV_BLUE` | | 573 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | |
| 574 | |`RGB_PURPLE` |`HSV_PURPLE` | | 574 | |`RGB_TEAL` |`HSV_TEAL` | |
| 575 | |`RGB_MAGENTA` |`HSV_MAGENTA` | | 575 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | |
| 576 | |`RGB_PINK` |`HSV_PINK` | | 576 | |`RGB_WHITE` |`HSV_WHITE` | |
| 577 | 577 | |`RGB_YELLOW` |`HSV_YELLOW` | | |
| 578 | These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! | 578 | |
| 579 | These are defined in [`color.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/color.h). Feel free to add to this list! | ||
| 579 | 580 | ||
| 580 | 581 | ||
| 581 | ## Additional `config.h` Options :id=additional-configh-options | 582 | ## Additional `config.h` Options :id=additional-configh-options |
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 0e75411f0..d323dee4f 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md | |||
| @@ -449,26 +449,27 @@ rgblight_sethsv_at(HSV_GREEN, 2); // led 2 | |||
| 449 | 449 | ||
| 450 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. | 450 | These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. |
| 451 | 451 | ||
| 452 | |RGB |HSV | | 452 | |RGB |HSV | |
| 453 | |-------------------|-------------------| | 453 | |---------------------|---------------------| |
| 454 | |`RGB_WHITE` |`HSV_WHITE` | | 454 | |`RGB_AZURE` |`HSV_AZURE` | |
| 455 | |`RGB_RED` |`HSV_RED` | | 455 | |`RGB_BLACK`/`RGB_OFF`|`HSV_BLACK`/`HSV_OFF`| |
| 456 | |`RGB_CORAL` |`HSV_CORAL` | | 456 | |`RGB_BLUE` |`HSV_BLUE` | |
| 457 | |`RGB_ORANGE` |`HSV_ORANGE` | | 457 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | |
| 458 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | | 458 | |`RGB_CORAL` |`HSV_CORAL` | |
| 459 | |`RGB_GOLD` |`HSV_GOLD` | | 459 | |`RGB_CYAN` |`HSV_CYAN` | |
| 460 | |`RGB_YELLOW` |`HSV_YELLOW` | | 460 | |`RGB_GOLD` |`HSV_GOLD` | |
| 461 | |`RGB_CHARTREUSE` |`HSV_CHARTREUSE` | | 461 | |`RGB_GOLDENROD` |`HSV_GOLDENROD` | |
| 462 | |`RGB_GREEN` |`HSV_GREEN` | | 462 | |`RGB_GREEN` |`HSV_GREEN` | |
| 463 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | | 463 | |`RGB_MAGENTA` |`HSV_MAGENTA` | |
| 464 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | | 464 | |`RGB_ORANGE` |`HSV_ORANGE` | |
| 465 | |`RGB_TEAL` |`HSV_TEAL` | | 465 | |`RGB_PINK` |`HSV_PINK` | |
| 466 | |`RGB_CYAN` |`HSV_CYAN` | | 466 | |`RGB_PURPLE` |`HSV_PURPLE` | |
| 467 | |`RGB_AZURE` |`HSV_AZURE` | | 467 | |`RGB_RED` |`HSV_RED` | |
| 468 | |`RGB_BLUE` |`HSV_BLUE` | | 468 | |`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` | |
| 469 | |`RGB_PURPLE` |`HSV_PURPLE` | | 469 | |`RGB_TEAL` |`HSV_TEAL` | |
| 470 | |`RGB_MAGENTA` |`HSV_MAGENTA` | | 470 | |`RGB_TURQUOISE` |`HSV_TURQUOISE` | |
| 471 | |`RGB_PINK` |`HSV_PINK` | | 471 | |`RGB_WHITE` |`HSV_WHITE` | |
| 472 | |`RGB_YELLOW` |`HSV_YELLOW` | | ||
| 472 | 473 | ||
| 473 | ```c | 474 | ```c |
| 474 | rgblight_setrgb(RGB_ORANGE); | 475 | rgblight_setrgb(RGB_ORANGE); |
| @@ -477,7 +478,7 @@ rgblight_setrgb_at(RGB_GOLD, 3); | |||
| 477 | rgblight_sethsv_range(HSV_WHITE, 0, 6); | 478 | rgblight_sethsv_range(HSV_WHITE, 0, 6); |
| 478 | ``` | 479 | ``` |
| 479 | 480 | ||
| 480 | These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! | 481 | These are defined in [`color.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/color.h). Feel free to add to this list! |
| 481 | 482 | ||
| 482 | 483 | ||
| 483 | ## Changing the order of the LEDs | 484 | ## Changing the order of the LEDs |
diff --git a/quantum/color.h b/quantum/color.h index 4783f6839..e2cfc4692 100644 --- a/quantum/color.h +++ b/quantum/color.h | |||
| @@ -19,6 +19,60 @@ | |||
| 19 | #include <stdint.h> | 19 | #include <stdint.h> |
| 20 | #include <stdbool.h> | 20 | #include <stdbool.h> |
| 21 | 21 | ||
| 22 | // clang-format off | ||
| 23 | |||
| 24 | /* | ||
| 25 | * RGB Colors | ||
| 26 | */ | ||
| 27 | #define RGB_AZURE 0x99, 0xF5, 0xFF | ||
| 28 | #define RGB_BLACK 0x00, 0x00, 0x00 | ||
| 29 | #define RGB_BLUE 0x00, 0x00, 0xFF | ||
| 30 | #define RGB_CHARTREUSE 0x80, 0xFF, 0x00 | ||
| 31 | #define RGB_CORAL 0xFF, 0x7C, 0x4D | ||
| 32 | #define RGB_CYAN 0x00, 0xFF, 0xFF | ||
| 33 | #define RGB_GOLD 0xFF, 0xD9, 0x00 | ||
| 34 | #define RGB_GOLDENROD 0xD9, 0xA5, 0x21 | ||
| 35 | #define RGB_GREEN 0x00, 0xFF, 0x00 | ||
| 36 | #define RGB_MAGENTA 0xFF, 0x00, 0xFF | ||
| 37 | #define RGB_ORANGE 0xFF, 0x80, 0x00 | ||
| 38 | #define RGB_PINK 0xFF, 0x80, 0xBF | ||
| 39 | #define RGB_PURPLE 0x7A, 0x00, 0xFF | ||
| 40 | #define RGB_RED 0xFF, 0x00, 0x00 | ||
| 41 | #define RGB_SPRINGGREEN 0x00, 0xFF, 0x80 | ||
| 42 | #define RGB_TEAL 0x00, 0x80, 0x80 | ||
| 43 | #define RGB_TURQUOISE 0x47, 0x6E, 0x6A | ||
| 44 | #define RGB_WHITE 0xFF, 0xFF, 0xFF | ||
| 45 | #define RGB_YELLOW 0xFF, 0xFF, 0x00 | ||
| 46 | #define RGB_OFF RGB_BLACK | ||
| 47 | |||
| 48 | /* | ||
| 49 | * HSV Colors | ||
| 50 | * | ||
| 51 | * All values (including hue) are scaled to 0-255 | ||
| 52 | */ | ||
| 53 | #define HSV_AZURE 132, 102, 255 | ||
| 54 | #define HSV_BLACK 0, 0, 0 | ||
| 55 | #define HSV_BLUE 170, 255, 255 | ||
| 56 | #define HSV_CHARTREUSE 64, 255, 255 | ||
| 57 | #define HSV_CORAL 11, 176, 255 | ||
| 58 | #define HSV_CYAN 128, 255, 255 | ||
| 59 | #define HSV_GOLD 36, 255, 255 | ||
| 60 | #define HSV_GOLDENROD 30, 218, 218 | ||
| 61 | #define HSV_GREEN 85, 255, 255 | ||
| 62 | #define HSV_MAGENTA 213, 255, 255 | ||
| 63 | #define HSV_ORANGE 28, 255, 255 | ||
| 64 | #define HSV_PINK 234, 128, 255 | ||
| 65 | #define HSV_PURPLE 191, 255, 255 | ||
| 66 | #define HSV_RED 0, 255, 255 | ||
| 67 | #define HSV_SPRINGGREEN 106, 255, 255 | ||
| 68 | #define HSV_TEAL 128, 255, 128 | ||
| 69 | #define HSV_TURQUOISE 123, 90, 112 | ||
| 70 | #define HSV_WHITE 0, 0, 255 | ||
| 71 | #define HSV_YELLOW 43, 255, 255 | ||
| 72 | #define HSV_OFF HSV_BLACK | ||
| 73 | |||
| 74 | // clang-format on | ||
| 75 | |||
| 22 | #if defined(__GNUC__) | 76 | #if defined(__GNUC__) |
| 23 | # define PACKED __attribute__((__packed__)) | 77 | # define PACKED __attribute__((__packed__)) |
| 24 | #else | 78 | #else |
diff --git a/quantum/rgblight_list.h b/quantum/rgblight/rgblight_list.h index f29a646b6..0fd68b75f 100644 --- a/quantum/rgblight_list.h +++ b/quantum/rgblight/rgblight_list.h | |||
| @@ -15,49 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #pragma once | 16 | #pragma once |
| 17 | 17 | ||
| 18 | /* RGB COLORS */ | 18 | #include "color.h" |
| 19 | #define RGB_WHITE 0xFF, 0xFF, 0xFF | ||
| 20 | #define RGB_RED 0xFF, 0x00, 0x00 | ||
| 21 | #define RGB_CORAL 0xFF, 0x7C, 0x4D | ||
| 22 | #define RGB_ORANGE 0xFF, 0x80, 0x00 | ||
| 23 | #define RGB_GOLDENROD 0xD9, 0xA5, 0x21 | ||
| 24 | #define RGB_GOLD 0xFF, 0xD9, 0x00 | ||
| 25 | #define RGB_YELLOW 0xFF, 0xFF, 0x00 | ||
| 26 | #define RGB_CHARTREUSE 0x80, 0xFF, 0x00 | ||
| 27 | #define RGB_GREEN 0x00, 0xFF, 0x00 | ||
| 28 | #define RGB_SPRINGGREEN 0x00, 0xFF, 0x80 | ||
| 29 | #define RGB_TURQUOISE 0x47, 0x6E, 0x6A | ||
| 30 | #define RGB_TEAL 0x00, 0x80, 0x80 | ||
| 31 | #define RGB_CYAN 0x00, 0xFF, 0xFF | ||
| 32 | #define RGB_AZURE 0x99, 0xf5, 0xFF | ||
| 33 | #define RGB_BLUE 0x00, 0x00, 0xFF | ||
| 34 | #define RGB_PURPLE 0x7A, 0x00, 0xFF | ||
| 35 | #define RGB_MAGENTA 0xFF, 0x00, 0xFF | ||
| 36 | #define RGB_PINK 0xFF, 0x80, 0xBF | ||
| 37 | #define RGB_BLACK 0x00, 0x00, 0x00 | ||
| 38 | #define RGB_OFF RGB_BLACK | ||
| 39 | |||
| 40 | /* HSV COLORS */ | ||
| 41 | #define HSV_WHITE 0, 0, 255 | ||
| 42 | #define HSV_RED 0, 255, 255 | ||
| 43 | #define HSV_CORAL 11, 176, 255 | ||
| 44 | #define HSV_ORANGE 28, 255, 255 | ||
| 45 | #define HSV_GOLDENROD 30, 218, 218 | ||
| 46 | #define HSV_GOLD 36, 255, 255 | ||
| 47 | #define HSV_YELLOW 43, 255, 255 | ||
| 48 | #define HSV_CHARTREUSE 64, 255, 255 | ||
| 49 | #define HSV_GREEN 85, 255, 255 | ||
| 50 | #define HSV_SPRINGGREEN 106, 255, 255 | ||
| 51 | #define HSV_TURQUOISE 123, 90, 112 | ||
| 52 | #define HSV_TEAL 128, 255, 128 | ||
| 53 | #define HSV_CYAN 128, 255, 255 | ||
| 54 | #define HSV_AZURE 132, 102, 255 | ||
| 55 | #define HSV_BLUE 170, 255, 255 | ||
| 56 | #define HSV_PURPLE 191, 255, 255 | ||
| 57 | #define HSV_MAGENTA 213, 255, 255 | ||
| 58 | #define HSV_PINK 234, 128, 255 | ||
| 59 | #define HSV_BLACK 0, 0, 0 | ||
| 60 | #define HSV_OFF HSV_BLACK | ||
| 61 | 19 | ||
| 62 | /* | 20 | /* |
| 63 | ######################################################################################## | 21 | ######################################################################################## |
| @@ -66,7 +24,7 @@ | |||
| 66 | ## ## | 24 | ## ## |
| 67 | ## The functions below have been deprecated and may be removed in a future release. ## | 25 | ## The functions below have been deprecated and may be removed in a future release. ## |
| 68 | ## ## | 26 | ## ## |
| 69 | ## Please use the values above with the RGB functions. ## | 27 | ## Please use the values in color.h with the RGB functions. ## |
| 70 | ## ## | 28 | ## ## |
| 71 | ## ## | 29 | ## ## |
| 72 | ## ## | 30 | ## ## |
