Skip to content

Commit

Permalink
Merge pull request #3 from Aircoookie/master
Browse files Browse the repository at this point in the history
merge upstream
  • Loading branch information
peacepenguin authored Oct 30, 2020
2 parents 632c588 + f046abe commit aa18c2a
Show file tree
Hide file tree
Showing 14 changed files with 204 additions and 290 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

### Development versions after the 0.10.2 release

#### Build 2010290

- Colorful effect now supports palettes
- Added C9 2 palette (#1291)
- Improved C9 palette brightness by 12%
- Disable onboard LED if LEDs are off (PR #1245)
- Added optional status LED (PR #1264)
- Realtime max. brightness now honors brightness factor (fixes #1271)
- Updated ArduinoJSON to 6.17.0

#### Build 2010020

- Fixed interaction of `T` and `NL` HTTP API commands (#1214)
Expand Down
171 changes: 125 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"homepage": "https://github.com/Aircoookie/WLED#readme",
"dependencies": {
"clean-css": "^4.2.3",
"html-minifier": "^4.0.0",
"html-minifier-terser": "^5.1.1",
"inliner": "^1.13.1",
"nodemon": "^2.0.4",
"zlib": "^1.0.5"
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ TM1814 | 12v | RGBW
WS2811 | 12v | 3-LED segments
WS2815 | 12v |
GS8208 | 12v |
Analog/non-addressable | any | Requires additional circuitry

## 🧊 Compatible PC RGB Fans and ARGB accessories
Brand | Model | Comments
Expand Down
4 changes: 2 additions & 2 deletions tools/cdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ${array}
}

const CleanCSS = require("clean-css");
const MinifyHTML = require("html-minifier").minify;
const MinifyHTML = require("html-minifier-terser").minify;

function filter(str, type) {
str = adoptVersionAndRepo(str);
Expand All @@ -119,7 +119,7 @@ function filter(str, type) {
collapseWhitespace: true,
maxLineLength: 80,
minifyCSS: true,
minifyJS: true,
minifyJS: true,
continueOnParseError: false,
removeComments: true,
});
Expand Down
44 changes: 19 additions & 25 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,46 +802,40 @@ uint16_t WS2812FX::mode_chase_rainbow_white(void) {
* Red - Amber - Green - Blue lights running
*/
uint16_t WS2812FX::mode_colorful(void) {
uint32_t cols[]{0x00FF0000,0x00EEBB00,0x0000EE00,0x000077CC,0x00FF0000,0x00EEBB00,0x0000EE00};
if (SEGMENT.intensity < 127) //pastel (easter) colors
uint8_t numColors = 4; //3, 4, or 5
uint32_t cols[9]{0x00FF0000,0x00EEBB00,0x0000EE00,0x000077CC};
if (SEGMENT.intensity > 160 || SEGMENT.palette) { //palette or color
if (!SEGMENT.palette) {
numColors = 3;
for (uint8_t i = 0; i < 3; i++) cols[i] = SEGCOLOR(i);
} else {
uint16_t fac = 80;
if (SEGMENT.palette == 52) {numColors = 5; fac = 61;} //C9 2 has 5 colors
for (uint8_t i = 0; i < numColors; i++) {
cols[i] = color_from_palette(i*fac, false, true, 255);
}
}
} else if (SEGMENT.intensity < 80) //pastel (easter) colors
{
cols[0] = 0x00FF8040;
cols[1] = 0x00E5D241;
cols[2] = 0x0077FF77;
cols[3] = 0x0077F0F0;
for (uint8_t i = 4; i < 7; i++) cols[i] = cols[i-4];
}
for (uint8_t i = numColors; i < numColors*2 -1; i++) cols[i] = cols[i-numColors];

uint32_t cycleTime = 50 + (15 * (uint32_t)(255 - SEGMENT.speed));
uint32_t cycleTime = 50 + (8 * (uint32_t)(255 - SEGMENT.speed));
uint32_t it = now / cycleTime;
if (it != SEGENV.step)
{
if (SEGMENT.speed > 0) SEGENV.aux0++;
if (SEGENV.aux0 > 3) SEGENV.aux0 = 0;
if (SEGENV.aux0 >= numColors) SEGENV.aux0 = 0;
SEGENV.step = it;
}

uint16_t i = 0;
for (i; i < SEGLEN -3; i+=4)
{
setPixelColor(i, cols[SEGENV.aux0]);
setPixelColor(i+1, cols[SEGENV.aux0+1]);
setPixelColor(i+2, cols[SEGENV.aux0+2]);
setPixelColor(i+3, cols[SEGENV.aux0+3]);
}
if(i < SEGLEN)
for (uint16_t i = 0; i < SEGLEN; i+= numColors)
{
setPixelColor(i, cols[SEGENV.aux0]);

if(i+1 < SEGLEN)
{
setPixelColor(i+1, cols[SEGENV.aux0+1]);

if(i+2 < SEGLEN)
{
setPixelColor(i+2, cols[SEGENV.aux0+2]);
}
}
for (uint16_t j = 0; j < numColors; j++) setPixelColor(i + j, cols[SEGENV.aux0 + j]);
}

return FRAMETIME;
Expand Down
2 changes: 1 addition & 1 deletion wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ const char JSON_palette_names[] PROGMEM = R"=====([
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
"Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura",
"Aurora","Atlantica"
"Aurora","Atlantica","C9 2"
])=====";

#endif
1 change: 1 addition & 0 deletions wled00/fcn_declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void colorUpdated(int callMode);
void updateInterfaces(uint8_t callMode);
void handleTransitions();
void handleNightlight();
byte scaledBri(byte in);

//lx_parser.cpp
bool parseLx(int lxValue, byte* rgbw);
Expand Down
Loading

0 comments on commit aa18c2a

Please sign in to comment.