lubeda / EspHoMaTriXv2

A simple DIY status display with a 8x32 RGB LED matrix, implemented with esphome.io and Home Assistant.
MIT License
269 stars 25 forks source link

2024.6.1: In `multicolor_text` mode, added the ability to reset to default color, improved documentation. #238

Closed andrewjswan closed 2 months ago

lubeda commented 2 months ago

Is there a way to analyze the text and the colors once instead of every draw cycle? This is slowing down everything in the loop.

perhaps with two arrays: filled on_next_screen

one for the string and the other for the RGB color.

Like

text[] ="ABC"
color[] =[(FF,0,0),(0,FF,0),(0,0,FF)]

The A is red, B is green, C is blue,

This opens a lot more possibilities, like giving each character one color or calculated gradients per character etc.

andrewjswan commented 2 months ago

image

andrewjswan commented 2 months ago

This opens a lot more possibilities, like giving each character one color or calculated gradients per character etc.

It seems to me that such a solution will consume a lot of memory, and will also increase the delay, because we will need to output letter by letter and set the color each time... But at the same time we will also need to get an array of colors for each letter.

andrewjswan commented 2 months ago

I thought about the solution for a long time, but I did not find a simple, effective and fast one that would fit into the concept of the current screens. But we can always try to optimize, improve and change this functionality.

lubeda commented 2 months ago

I will try to add my idea to the queue constructor, this is where this step really belongs to. It will cost some RAM but the timming will cause problems at the long run, with sensors etc.

andrewjswan commented 2 months ago

This PR adds flexibility to that functionality and a better example in the documentation. If you change the concept, it is better to use these changes as a basis.

andrewjswan commented 2 months ago

@lubeda Ant news?

lubeda commented 2 months ago

I still don't like the effects off this feature but the feature it self is nice.