Percent FX use % as index in palette.

FX Checkmark bugfix.
This commit is contained in:
Blaz Kristan 2022-09-21 21:09:52 +02:00
parent fc0dc4472b
commit 222b92807e
4 changed files with 509 additions and 502 deletions

View File

@ -3581,10 +3581,13 @@ uint16_t mode_percent(void) {
uint8_t size = (1 + ((SEGMENT.speed * SEGLEN) >> 11));
if (SEGMENT.speed == 255) size = 255;
if (percent < 100) {
if (percent <= 100) {
for (int i = 0; i < SEGLEN; i++) {
if (i < SEGENV.aux1) {
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
if (SEGMENT.check1)
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(map(percent,0,100,0,255), false, false, 0));
else
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
}
else {
SEGMENT.setPixelColor(i, SEGCOLOR(1));
@ -3596,7 +3599,10 @@ uint16_t mode_percent(void) {
SEGMENT.setPixelColor(i, SEGCOLOR(1));
}
else {
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
if (SEGMENT.check1)
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(map(percent,100,200,255,0), false, false, 0));
else
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(i, true, PALETTE_SOLID_WRAP, 0));
}
}
}
@ -3611,7 +3617,7 @@ uint16_t mode_percent(void) {
return FRAMETIME;
}
static const char _data_FX_MODE_PERCENT[] PROGMEM = "Percent@,% of fill;!,!,;!;1d";
static const char _data_FX_MODE_PERCENT[] PROGMEM = "Percent@,% of fill,,,,One color;!,!,;!;1d";
/*

View File

@ -1395,7 +1395,7 @@ function setEffectParameters(idx)
if (slOnOff.length>5) {
gId('fxopt').classList.remove('fade');
for (let i = 0; i<3; i++) {
if (slOnOff[5+i]!=='') {
if (5+i<slOnOff.length && slOnOff[5+i]!=='') {
gId('opt'+i).classList.remove('hide');
gId('optLabel'+i).innerHTML = slOnOff[5+i]=="!" ? 'Option' : slOnOff[5+i].substr(0,16);
} else

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2209201
#define VERSION 2209211
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG