Skip to content

Instantly share code, notes, and snippets.

@xairoo
Last active October 17, 2021 17:06
Show Gist options
  • Save xairoo/78fc7861605bfb11fa37ba3bafe5a4e1 to your computer and use it in GitHub Desktop.
Save xairoo/78fc7861605bfb11fa37ba3bafe5a4e1 to your computer and use it in GitHub Desktop.
Sample colored text using svg.
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="145" height="20"
>
<rect width="100%" height="100%" fill="black"/>
<text font-size="16" x="5" y="13">
<tspan fill="white">Sample </tspan>
<tspan fill="green">colored</tspan>
<tspan fill="white"> text.</tspan>
</text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment