Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have ColormapOverlay behave more like Colormap #1427

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

EvyBongers
Copy link
Contributor

@EvyBongers EvyBongers commented May 26, 2024

Adding support for specifying color overlays in a similar was as Colormap

Yet to do:

  • Find a way to convert key index to key address
  • Implement a way for ColormapOverlay to not override the led color
  • Implement validation of the colormap index specified (is that needed?)

Fixes #1424

Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Comment on lines 87 to 111
#define COLORMAP_OVERLAYS_MAP(layers...) \
namespace kaleidoscope { \
namespace plugin { \
const uint8_t overlays_[][kaleidoscope_internal::device.matrix_rows * kaleidoscope_internal::device.matrix_columns] = { \
layers \
}; \
ColormapOverlay.configureOverlays(overlays_); \
} /* plugin */ \
} /* kaleidoscope */

#define __IDENTITY__(X) X

#ifdef PER_KEY_DATA_STACKED
#define COLORMAP_OVERLAY_STACKED(...) \
{ \
MAP_LIST(__IDENTITY__, PER_KEY_DATA_STACKED(0, __VA_ARGS__)) \
}
#endif

#ifdef PER_KEY_DATA
#define COLORMAP_OVERLAY(...) \
{ \
MAP_LIST(__IDENTITY__, PER_KEY_DATA(0, __VA_ARGS__)) \
}
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly copy/paste from DefaultColormap. I'm wondering if the namespaces need to be specified like they are 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I guess test it?

Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Signed-off-by: Evy Bongers <evy@evybongers.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ColormapOverlay should work more like colormap
2 participants