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

Add Colormap-Overlay plugin #1359

Merged
merged 10 commits into from
Jan 8, 2024
Merged

Conversation

EvyBongers
Copy link
Contributor

No description provided.

@EvyBongers EvyBongers force-pushed the feat/Colormap-Overlay branch from 74ae4c5 to 14e8920 Compare November 14, 2023 15:37
@EvyBongers
Copy link
Contributor Author

Just now I found that there's a focus command for retrieving the palette, which had me find out that (it seems that) the palette isn't set correctly, though I don't know why.

Based on my findings, the colors are retrieved from the palette correctly, so it seems I'm missing something when setting the palette.

This is from my sketch:

enum {
  PALETTE_PURPLE,
  PALETTE_RED,
  PALETTE_GREEN,
  PALETTE_PINK,
  PALETTE_YELLOW,
  PALETTE_UNUSED_1,
  PALETTE_UNUSED_2,
  PALETTE_UNUSED_3,
  PALETTE_UNUSED_4,
  PALETTE_UNUSED_5,
  PALETTE_UNUSED_6,
  PALETTE_UNUSED_7,
  PALETTE_UNUSED_8,
  PALETTE_UNUSED_9,
  PALETTE_UNUSED_10,
  PALETTE_UNUSED_11,
};

PALETTE(
  [PALETTE_PURPLE] = CRGB(0x99, 0x11, 0xb5),
  [PALETTE_RED]    = CRGB(0xff, 0x00, 0x00),
  [PALETTE_GREEN]  = CRGB(0x1a, 0xb0, 0x04),
  [PALETTE_PINK]   = CRGB(0xd0, 0x08, 0x8a),
  [PALETTE_YELLOW] = CRGB(0xef, 0xca, 0x1c),
  // unused
  [PALETTE_UNUSED_1]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_2]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_3]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_4]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_5]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_6]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_7]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_8]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_9]  = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_10] = CRGB(0x00, 0x00, 0x00),
  [PALETTE_UNUSED_11] = CRGB(0x00, 0x00, 0x00)
)

And this is the palette as returned by the keyboard:

$ bin/focus-send palette |xargs -n3 printf '%02x%02x%02x\n'
a2feff
000064
05f63b
0000ff
ff0000
ffd6ff
cdfecd
fc17ff
a7fffd
0000fd
000000
000000
000000
000000
000000
000000

@EvyBongers EvyBongers force-pushed the feat/Colormap-Overlay branch 2 times, most recently from 3de0b54 to 0e7c39c Compare December 2, 2023 19:45
@EvyBongers EvyBongers marked this pull request as ready for review December 2, 2023 19:49
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
Signed-off-by: Evy Bongers <[email protected]>
@EvyBongers EvyBongers force-pushed the feat/Colormap-Overlay branch from 2decf4c to b8a0ab4 Compare December 2, 2023 19:51
#include <Kaleidoscope.h>
#include <Kaleidoscope-LEDControl.h>
#include <Kaleidoscope-LED-Palette-Theme.h>
#include <Kaleidoscope-Colormap.h> // DefaultColorMap
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 don't really like that I need to include this, just to have DefaultColormap.

Comment on lines +55 to +60
The extension only has a single method:

### `.setup()`

> Intended to be called from the `setup()` method of the sketch, it reserves the
> required space in EEPROM.
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 feel this shouldn't be needed at all. I tries moving the contents to ColormapOverlay::onSetup(), but that resulted in the overlays briefly flashing in their assigned color, before being turned off again.

Comment on lines +33 to +35
void ColormapOverlay::setup() {
map_base_ = ::LEDPaletteTheme.reserveThemes(1);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As stated above, I would prefer to remove this and move that single line to ColormapOverlay::onSetup(), but that doesn't work as I expect it to.

I'd appreciate some help

@obra obra merged commit fb54b31 into keyboardio:master Jan 8, 2024
7 of 8 checks passed
@EvyBongers EvyBongers deleted the feat/Colormap-Overlay branch January 8, 2024 22:07
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.

2 participants