Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text color customization #32

Open
4 tasks
IPdotSetAF opened this issue Jul 11, 2024 · 5 comments · May be fixed by #33
Open
4 tasks

text color customization #32

IPdotSetAF opened this issue Jul 11, 2024 · 5 comments · May be fixed by #33
Assignees
Labels
enhancement New feature or request

Comments

@IPdotSetAF
Copy link
Owner

IPdotSetAF commented Jul 11, 2024

add text color for the following settings:

  • day
  • date
  • clock
  • message

colors applys the same way that preserve logo color option works

@IPdotSetAF IPdotSetAF added enhancement New feature or request good first issue Good for newcomers labels Jul 11, 2024
@FullStackWebDeveloper-HARSH

Hi Mohammad Mahdi,

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

Thank you!

Best regards,
Harsh Tiwari

@IPdotSetAF
Copy link
Owner Author

Hello, Harsh.

Welcome, to the Matrix!

Feel free to ask any questions that comes up.

Good Luck.

@FullStackWebDeveloper-HARSH

Hi Mohammad Mahdi,

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

Best regards,
Harsh.

@FullStackWebDeveloper-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.

@IPdotSetAF
Copy link
Owner Author

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:

    function calculateColor(i, j, lightness) {

    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:

    staticChars[x + j][y + i + 1] = lines[i][j] != " " ? lines[i][j] : null;

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 :
    function drawTextOnMatrix(text, x, y) {

    input the color reference and insert it into the staticChars matrix.
  2. textScale > 0: still no solution

@IPdotSetAF IPdotSetAF removed the good first issue Good for newcomers label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants