iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔲

1px SVG code

に公開

I've added SVG code generation to the 1px x 1px PNG data URL generator tool I created previously.
1px data url generator

SVG Code Examples

This is achieved by specifying the color in the background property of the style attribute.

<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1" style="background: [COLOR CODE];"></svg>

XML Format

<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1" style="background: rgb(0, 0, 0);"></svg>
<!-- Alpha value -->
<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1" style="background: rgba(126, 211, 33, 0.5);"></svg>

Data URL

data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221%22%20height%3D%221%22%20style%3D%22background%3A%20rgba(102%2C%2045%2C%2045%2C%200.57)%3B%22%3E%3C%2Fsvg%3E
GitHubで編集を提案

Discussion