cancel
Showing results for 
Search instead for 
Did you mean: 

Adjustment of text colour

mids400
Associate III

Hello everyone,

I was wondering if there are some things that can be implemented in TouchGFX. I have implemented a project using TouchGFX, but then I want to implement another project that should depend on the first project.
I want to make the colours of the text, backgrounds and buttons customisable by allowing the owner to make the changes through the second application and create the .bin file and write it to the MCU.
I have already implemented the button and background colours using photos for the colours and this has already simplified this feature by pushing the new photos to the appropriate memory address. But the problem is with the text colours, because the project contains different texts with different colours. The project also contains 3 different languages. So you can imagine the amount of text so far. So I'm asking: is it possible to implement these features or not?

If anyone has an idea I would be very grateful...

Kind regards
Mahdi

7 REPLIES 7
Issamos
Lead II

Hello @mids400 

I think those two posts may give some help.

Best regards .

II

Hello @Issamos 

I think the two posts are in a different direction of my application. They talking about the change colours in the same project or view without need to create another view, which it has the abiliy to change every thing in another project at appropriate address.

Best regards

Mahdi

mids400
Associate III

Hello @higgs147 

At first thank you for your reply.. 

I found it almost impossible to change the texts because the texts are not stored in the database but as just an array of hexadecimal values. Also, each text had its own number of values, so any change in the text causes an error in the other texts. In this case all texts have to be changed otherwise something might go wrong.

As for the colours, I believe each text object has its own colour, which is painted in the form of RGB. So how could the colour config be stored in database? Please imaging that there are more than 150 texts within the project.

Therefore, I need a mechanism to distribute the texts in groups then the colours of each group could be customizable e.g. Each resource has a specific colour. But I still need more explanation to create the config file.

Best regards

Mahdi

MM..1
Chief II

I see your idea , but this is complete outside TouchGFX problem. On your screensetup codes you require add "custom" overide object params...

@MM..1 could you please explaine your suggestion? 

Simply 

Screen0View::customizeView()
{
somethinkstruct mycustom = (somethinkstruct *) (semowhereBIN + header size); //pointer to struct

textArea1.setColor(touchgfx::Color::getColorFromRGB(mycustom.colred[1], mycustom.colgreen[1], mycustom.colblue[1]));
... for all objects
}

void Screen0View::setupScreen()
{
    Screen0ViewBase::setupScreen();
if(somethink_somewhereBIN) customizeView();
}

Sorry, the suggestion was also in another direction. The closest answer was from @higgs147, but unfortunately I couldn't use a new complete approach at the moment because it would require more and more changes.

I will try to take some of their points, maybe I got something. 

This discussion will stay open until I get something else, then I will post the answer for everyone to use.