Changing colors without WebStyles?

I have 800 colors in my database. The user can choose one of them.
I think the best way is a popup, with a table of all colors, and the user should click a cell to choose the color.

Now my problem: Do I really have to make 800 WebStyles for these colors? I have the RGB values in my database, can I change the colors of cells by giving it the RGB values without WebStyles?

Another solution would be 800 pictures with this colors, but thats sounds creepy too. :frowning:

If you searched before asking questions, you would see that the solution has already been posted
https://forum.xojo.com/25923-set-background-color-of-page-in-code/0

Every time I post a new topic, I search before.
And yes, I found this page. But this is two years old. And JavaScript sounds not like the correct way. I’m searching for a Xojo-Only way.

[I]Offtopic:
If you go to the Xojo-Webseite. There is a big topic “Develop Faster”:

Quote: “Use one powerful language to create your web app instead of HTML, CSS, PHP, JavaScript, or AJAX, saving you tons of development time.”

I don’t want to mix Xojo with JavaScript. Only Xojo. ;)[/i]

[quote=348910:@Marcel Zimmer]Every time I post a new topic, I search before.
And yes, I found this page. But this is two years old. And JavaScript sounds not like the correct way. I’m searching for a Xojo-Only way.

[I]Offtopic:
If you go to the Xojo-Webseite. There is a big topic “Develop Faster”:

Quote: “Use one powerful language to create your web app instead of HTML, CSS, PHP, JavaScript, or AJAX, saving you tons of development time.”

I don’t want to mix Xojo with JavaScript. Only Xojo. ;)[/i][/quote]
There’s no Xojo-only way to do this, and you wouldn’t be mixing languages. Xojo already contains HTML, CSS and JavaScript.

I think I have a new good idea to solve it in Xojo without JavaScript. I write my solution here, when it works. :slight_smile:

Actually I’m wrong. You could use raw html. Populate the rows using the new tag and you can specify colors directly.

<raw><font color=“#FF0000”>text here</font></raw>

The color is hexadecimal RGB.

Greg, you are the best!!!

Thats a super easy way. Thank you!!

I promised to post the solution. At the end I used Greg’s “raw”-Tag version:


  While Not data.EOF
     coloredgaudy = "<raw><font color=" + data.IdxField(5).StringValue  + ">" +chr(9608)+chr(9608)+chr(9608)+chr(9608)+chr(9608)+chr(9608) + " </font></raw>"
    
    ListBox_Colors.AddRow (data.IdxField(1).StringValue, data.IdxField(2).StringValue, data.IdxField(3).StringValue, coloredgaudy, data.IdxField(4).StringValue)
    
    data.MoveNext
  Wend

No JavaScript, and really cool! Thanks again, Greg!