<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Treat color as a variable?]]></title><description><![CDATA[<p dir="auto">I was thinking of a project to teach my nephew programming, and wanted to pick a random color from a list by name, but none of the the blocks in Graphic or Screen treat color as a variable.</p>
<p dir="auto">I did find this old feature suggestion in the forum, which is how I would expect it to work, given a presumed "set variable to RGB values" block...</p>
<p dir="auto">RE: <a href="/topic/558/uiflow-interface-suggestions">UiFlow interface suggestions</a></p>
<p dir="auto">Is there some other way I am missing?</p>
]]></description><link>https://community.m5stack.com/topic/3490/treat-color-as-a-variable</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:48:29 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3490.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2021 20:43:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Treat color as a variable? on Sat, 31 Jul 2021 07:33:54 GMT]]></title><description><![CDATA[<p dir="auto">Ahh I see.<br />
No, that just the way the blockly GUI options work in that you have to drag the UI element to the virtual screen to access the functions.<br />
Have you considered<br />
<img src="/assets/uploads/files/1627716157749-screenshot-2021-07-31-at-08.21.26.png" alt="0_1627716155995_Screenshot 2021-07-31 at 08.21.26.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Which then creates a hidden placeholder line which then give you access to the functions?<br />
and then you create a function to create a line with a random colour.<br />
<img src="/assets/uploads/files/1627716829375-screenshot-2021-07-31-at-08.33.25.png" alt="0_1627716826585_Screenshot 2021-07-31 at 08.33.25.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Edit Ahh I see, UI line and lcd line have different color functions</p>
]]></description><link>https://community.m5stack.com/post/14557</link><guid isPermaLink="true">https://community.m5stack.com/post/14557</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 31 Jul 2021 07:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to Treat color as a variable? on Fri, 30 Jul 2021 13:30:44 GMT]]></title><description><![CDATA[<p dir="auto">Yes, but that only works if you drag a line to the screen and manually pre-define the placement and dimensions. You can then alter those later, but it's just the one line.</p>
<p dir="auto">I want to programmatically draw multiple lines (via LCD.line) with random color(s) and there does not seem to be a Blockly way to achieve that (I'd prefer not to delve into executing Python code for this...)</p>
]]></description><link>https://community.m5stack.com/post/14551</link><guid isPermaLink="true">https://community.m5stack.com/post/14551</guid><dc:creator><![CDATA[Phi]]></dc:creator><pubDate>Fri, 30 Jul 2021 13:30:44 GMT</pubDate></item><item><title><![CDATA[Reply to Treat color as a variable? on Fri, 30 Jul 2021 07:48:54 GMT]]></title><description><![CDATA[<p dir="auto">I just checked and if you look at the attached image: <img src="/assets/uploads/files/1627631254882-screenshot-2021-07-30-at-08.47.14.png" alt="0_1627631253447_Screenshot 2021-07-30 at 08.47.14.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It is possible to set variable for the individual colours on a numerical value.</p>
]]></description><link>https://community.m5stack.com/post/14548</link><guid isPermaLink="true">https://community.m5stack.com/post/14548</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Fri, 30 Jul 2021 07:48:54 GMT</pubDate></item></channel></rss>