Img src from hex color?
<p>I need to add some alt text and/or titles to some image tags on a webpage.</p>

<p>The html structure is not really in my control, so image tags are required even though the tags themselves are being set to display a flat colour derived from a hex-code stored in a SQL table.</p>

<p><strong>Like This</strong></p>

<p><code>&lt;img style="background-color:{@hexCode};" title="{@colourName}"/&gt;</code></p>

<p>With <code>@hexCode</code> being the colour code in question (i.e. '#1f1f1f') and <code>@colourName</code> being the descriptive name for the colour chosen by the client.</p>

<p>The problem I'm having is that because the colour is being set by the <code>background-color</code>property the title text (and alt text does this too) is being displayed on top of the colour as well as on hover.</p>

<p><a href="https://i.stack.imgur.com/uP8M2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uP8M2.png" alt="Titles should not be visible here"></a></p>

<p>Google has not given me any useful solutions and I can't just not add the titles to the images? What should I do?</p>