Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local generator always shows green #19

Closed
texnofobix opened this issue Sep 17, 2021 · 1 comment · Fixed by #20
Closed

local generator always shows green #19

texnofobix opened this issue Sep 17, 2021 · 1 comment · Fixed by #20

Comments

@texnofobix
Copy link
Contributor

texnofobix commented Sep 17, 2021

Excuse my lack of detail as I am currently on mobile. After trying the svg version setting color="red" creates a green badge.

from genbadge import Badge

b = Badge(left_txt="foo", right_txt="bar", color="red")
print(b)
b.write_to("tmp_badge.svg", use_shields=False)

output from print is:

[ foo | bar ]  color: red

svg shows:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="58" height="20" role="img" aria-label="foo: bar">
	<title>foo: bar</title>
	<linearGradient id="s" x2="0" y2="100%">
		<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
		<stop offset="1" stop-opacity=".1"/>
	</linearGradient>
	<clipPath id="r">
		<rect width="58" height="20" rx="3" fill="#fff"/>
	</clipPath>
	<g clip-path="url(#r)">
		<rect width="29" height="20" fill="#555"/>
		<rect x="29" width="29" height="20" fill="#97ca00"/>
		<rect width="58" height="20" fill="url(#s)"/>
	</g>
	<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
		<text aria-hidden="true" x="155.0" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="190">foo</text>
		<text x="155.0" y="140" transform="scale(.1)" fill="#fff" textLength="190">foo</text>
		<text aria-hidden="true" x="425.0" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="190">bar</text>
		<text x="425.0" y="140" transform="scale(.1)" fill="#fff" textLength="190">bar</text>
	</g>
</svg>

which #97ca00 is not red.

@texnofobix
Copy link
Contributor Author

Submitted #20 to address this. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant