Color.FillColor missing?

This line:

txt.Style.BackgroundColor = Color.FillColor

Generates this error message:

Type “Color” has no member named “FillColor”
txt.Style.BackgroundColor = Color.FillColor

txt is a WebTextField
What am I doing wrong?

you could add a feature request via feedback tool or use a method and return any value with Color.RGB

Or perhaps a bug report.
Just want to make sure I don’t misinterpret the language reference which states “FillColor matches the default Window Background on all platforms”

On a technical level, that note is correct. With Xojo Web, the class is WebPage not Window.

Unless you’ve changed it, the default background color of a WebPage is white &cFFFFFF.

In Web 2.0 controls all have a reference to the page they are on so in theory you can easily get the page background color with self.Page.Style.BackgroundColor (or specifically in your case txt.Style.BackgroundColor = txt.Page.Style.BackgroundColor).

This is all “in theory” because I haven’t tested it. :innocent:

Makes sense, kind of =)
I just got hung up on the phrase “all platforms”.

The workaround works btw, thanks

I’ve filed a ticket for the docs to be updated #64000 - [Documentation] Color.FillColor missing Supported Platforms section

1 Like