Changing background color

I want to build an app with a textbox and a button and my aim is to change the background of the screen on clicking the button as per the user's input of the color name in the textbox. I tried the following combination but it returns an error message. How I make it possible?

problemBlocks

BackgroundColor property accepts integer while TextBox text is a String so you should set TextBox type to Numbers only.

So I need to enter only rgb values for it to work? Is there no way to change the color as per the "text" in the textbox?

What is the "text" you are expecting ?

I think it's about the names colors "red", "black" etc... You'd have to use an extension that uses the "parseColor()" java method. Then you could arrange the colors with words. You can also use a dictionary to build your own color base.

2 Likes

Here is a CSV table of color names and their values you can load into a dictionary at startup.

Use the keys for Elements of your List Picker, and the values for the colors.
color_codes.txt (2.4 KB)

Here is a sample app using those codes:


Capture
Color_code_scroller.aia (11.2 KB)

1 Like

now that's a good solution

Thank you sooo much. It works!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.