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

Merged
merged 8 commits into from
Aug 7, 2024

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 <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't felt motivated to pursue this and messing with it could open a can of worms, so I just marked the PR ready to be merged. If I end up pursuing this, I'll do so in a separate PR.

@EvyBongers EvyBongers marked this pull request as ready for review July 12, 2024 06:21
@obra obra merged commit 17971c4 into keyboardio:master Aug 7, 2024
8 checks passed
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