So, I went away and tried a few things, and have realized that I don't want it to be completely random. I forgot one of the main tenets of randomness; that it's clumpy. I was visually ending up with groupings of similar or identical colours, where I want more a rainbow. That said, I decided a different approach might get me what I wanted and created 10 8x8 PNG files, labeled col0.png-col9.png and created the following variable:
xml:
<variable name="ColourPic">
<value condition="String.EndsWith(Container.CurrentItem,0)">special://skin/randomcolours/col0.png</value>
<value condition="String.EndsWith(Container.CurrentItem,1)">special://skin/randomcolours/col1.png</value>
<value condition="String.EndsWith(Container.CurrentItem,2)">special://skin/randomcolours/col2.png</value>
<value condition="String.EndsWith(Container.CurrentItem,3)">special://skin/randomcolours/col3.png</value>
<value condition="String.EndsWith(Container.CurrentItem,4)">special://skin/randomcolours/col4.png</value>
<value condition="String.EndsWith(Container.CurrentItem,5)">special://skin/randomcolours/col5.png</value>
<value condition="String.EndsWith(Container.CurrentItem,6)">special://skin/randomcolours/col6.png</value>
<value condition="String.EndsWith(Container.CurrentItem,7)">special://skin/randomcolours/col7.png</value>
<value condition="String.EndsWith(Container.CurrentItem,8)">special://skin/randomcolours/col8.png</value>
<value condition="String.EndsWith(Container.CurrentItem,9)">special://skin/randomcolours/col9.png</value>
</variable>
And inserted the following into my itemlayout and focusedlayout of my View_50_List.xml:
xml:
<control type="image">
<top>5</top>
<left>10</left>
<width>110</width>
<height>110</height>
<texture background="true">$VAR[ColourPic]</texture>
</control>
A fairly straightforward approach that I assumed would quickly garner the results I wanted. Item 38 in the list should display col8.png, item 304 should display col4.png, etc. But things got weird, I got clumping and colours changing every time they lose visibility and return to visibility and focus colours being different than unfocused:
All these were taken with no change to the code. As far as I'm aware, Container.CurrentItem numbers are static and sequential once a list is generated, no? So either I'm completely wrong about what String.EndsWith() does or it's doing really weird things it shouldn't (like reading the string all at once instead of left-right or right-left) and getting confused about the numbers, or something else is giving the boolean a different number than what's expected.
Am I wrong here? Or is this result unexpected?