<?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[Converting Hex color to uint_16]]></title><description><![CDATA[<p dir="auto">I'm trying to use the fillScreen() method for the LCD, which expects a color in uint_16.</p>
<p dir="auto">I'm currently fetching the color as a a HEX via a <a href="https://m5stack.glitch.me/getColor" target="_blank" rel="noopener noreferrer nofollow ugc">GET request to a service</a>, which is returning a String value such as "#ff0000"</p>
<p dir="auto">I need to convert the string value from the GET request into a uint_16 so that I can set the color.</p>
<p dir="auto"><code>uint16_t color = (uint16_t) strtol(http.getString(), NULL, 16);</code></p>
<p dir="auto">Which gives me the error</p>
<pre><code>cannot convert 'String' to 'const char*' for argument '1' to 'long int strtol(const char*, char**, int)'
</code></pre>
<p dir="auto">Any recommended way to generate the uint_16 color from a HEX string?</p>
]]></description><link>https://community.m5stack.com/topic/1427/converting-hex-color-to-uint_16</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 06:22:04 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1427.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Oct 2019 02:47:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Converting Hex color to uint_16 on Wed, 30 Oct 2019 20:36:08 GMT]]></title><description><![CDATA[<p dir="auto">Check out W3Schools as they have tables for the multiple colour systems and codes used on the web.</p>
<p dir="auto">FF0000 = 255.0.0</p>
]]></description><link>https://community.m5stack.com/post/6216</link><guid isPermaLink="true">https://community.m5stack.com/post/6216</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 30 Oct 2019 20:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to Converting Hex color to uint_16 on Wed, 30 Oct 2019 13:03:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2293">@scientiffic</a> Hi， you could use this web tool to convert it</p>
]]></description><link>https://community.m5stack.com/post/6208</link><guid isPermaLink="true">https://community.m5stack.com/post/6208</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Wed, 30 Oct 2019 13:03:48 GMT</pubDate></item></channel></rss>