Coloured Items in a Script

How can I set an item colour via a script using an HTML format ? I can get basic “clGreen” to work, but not sure how the tcolor system actually translates…

Example:
CurrentPlaylist.GetItem(i).SetColored(true);
CurrentPlaylist.GetItem(i).SetColor(’#FFFFFF’);

It doesn’t like the #FFFFFF bit ;( I’d like to bulk-change some files to a certain colour, but have tried various formats and can’t get it to accept it…

TColor is nothing but an ordinary 32-bit integer number, with the three lower bytes specifying the RGB values, but in reverse order. Using the “$” sign as the Pascal-style prefix for hex numbers, translation is fairly easy. For example, the HTML color #AABBCC turns into $CCBBAA.

Thanks, that works fine - Although there are some very subtle differences in colour to those set via the built-in “pallette” via Item Properties.

Strange - although the resulting XML (mlp) output is identical?

I didn’t think to look!

Strangely, there ARE different…

Set Manually via the palette:
#80FF80

Set via the Script:
#08FF08

Edit: The HTML doesn’t need to be backwards :wink:

Actually, it’s not all backwards, but only the bytes (pairs of characters) are backwards. Here’s a better example:

#123456 => $563412

Sorry for the confusion :wink: