NeoMatrix icon indicating copy to clipboard operation
NeoMatrix copied to clipboard

text color customization

Open IPdotSetAF opened this issue 1 year ago • 5 comments

add text color for the following settings:

  • [ ] day
  • [ ] date
  • [ ] clock
  • [ ] message

colors applys the same way that preserve logo color option works

IPdotSetAF avatar Jul 11 '24 20:07 IPdotSetAF

Hi Mohammad Mahdi,

I would like to work on this issue. Could you please assign it to me?

Thank you!

Best regards, Harsh Tiwari

Hello, Harsh.

Welcome, to the Matrix!

Feel free to ask any questions that comes up.

Good Luck.

IPdotSetAF avatar Jul 12 '24 17:07 IPdotSetAF

Hi Mohammad Mahdi,

Thank you for assigning this issue to me. I will start working on it right away.

Best regards, Harsh.

Hi Mohammad Mahdi,

I hope this message finds you well. I wanted to inform you that I have recently submitted a Pull Request to your repository NeoMatrix. The Pull Request introduces a new feature that add text color customization to Day, Date, Message, and Clock settings. This enhancement aims to improve the user experience by providing more personalization options, making it easier for users to categorize and prioritize their tasks visually.

I would greatly appreciate it if you could take some time to review the Pull Request at your earliest convenience. Your feedback and suggestions would be invaluable in ensuring the quality and functionality of this new feature.

Thank you for maintaining this open-source project and considering my contribution. Looking forward to your feedback.

Best regards, Harsh.

ok, i think i had to explain the methodology a bit more, as it is not completely clear.

  1. to apply color on the texts, there is a method: https://github.com/IPdotSetAF/NeoMatrix/blob/1c7c55ef2ff4e8945c7489c076711304def60346/js/index.js#L1117

    this method calculates the color of any character on the screen.

  2. to store persistence text, we have a matrix that holds these characters, called staticChars: https://github.com/IPdotSetAF/NeoMatrix/blob/1c7c55ef2ff4e8945c7489c076711304def60346/js/index.js#L895

Step 1

  1. now we need to store and recall the color of any character on the screen, therefore we have to add another dimension to the staticChars matrix to store it's color.
  2. for memory optimizations we won't store the color itself in that matrix but only a reference to it being {null: not specified, 0: dayColor, 1: dateColor, 2: messageColor, 3: clockColor}
  3. for performance measures and to skip usage of a switch case in calculateColor() function, we have to add another array called colorPallet that holds all 4 static colors in the previously given index(0:day, 1:date, 2:message, 3:clock)
  4. in the calculateColor() function, you should have a look up into the newly structured staticChars matrix and if the value corresponding the character color was not null, look up the color from colorPallet array and return it.

Step 2

  1. we need to input the colors properly and store theme inside the colorPallet, for that, for onChange of ui_..._higlight and ui_..._textColor you need to call 2 functions in this order
    1. another new function called fillColorPallet() this function will fill the array of colorPallet from options object.
    2. updateMask()

Step 3

now we need to fill the staticChars matrix. there are two scenarios

  1. textScale == 0: in this function : https://github.com/IPdotSetAF/NeoMatrix/blob/1c7c55ef2ff4e8945c7489c076711304def60346/js/index.js#L876 input the color reference and insert it into the staticChars matrix.
  2. textScale > 0: ~still no solution~

IPdotSetAF avatar Jul 18 '24 06:07 IPdotSetAF