@ -28,7 +28,7 @@ namespace plugin {
uint16_t ColormapEffect : : map_base_ ;
uint8_t ColormapEffect : : max_layers_ ;
uint8_t ColormapEffect : : last_highest _layer_;
uint8_t ColormapEffect : : top _layer_;
void ColormapEffect : : max_layers ( uint8_t max_ ) {
if ( map_base_ ! = 0 )
@ -42,21 +42,20 @@ void ColormapEffect::onActivate(void) {
if ( ! Kaleidoscope . has_leds )
return ;
last_highest _layer_ = Layer . top ( ) ;
if ( last_highest _layer_ < = max_layers_ )
: : LEDPaletteTheme . updateHandler ( map_base_ , last_highest _layer_) ;
top _layer_ = Layer . top ( ) ;
if ( top _layer_ < = max_layers_ )
: : LEDPaletteTheme . updateHandler ( map_base_ , top _layer_) ;
}
void ColormapEffect : : update ( void ) {
if ( ! Kaleidoscope . has_leds | | Layer . top ( ) = = last_highest_layer_ )
return ;
onActivate ( ) ;
void ColormapEffect : : refreshAt ( byte row , byte col ) {
if ( top_layer_ < = max_layers_ )
: : LEDPaletteTheme . refreshAt ( map_base_ , top_layer_ , row , col ) ;
}
void ColormapEffect : : refreshAt ( byte row , byte col ) {
if ( last_highest_layer_ < = max_layers_ )
: : LEDPaletteTheme . refreshAt ( map_base_ , last_highest_layer_ , row , col ) ;
EventHandlerResult ColormapEffect : : onLayerChange ( ) {
if ( : : LEDControl . get_mode ( ) = = this )
onActivate ( ) ;
return EventHandlerResult : : OK ;
}
EventHandlerResult ColormapEffect : : onFocusEvent ( const char * command ) {