Skip to content

Added backgroundOpacity option #74

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrKragh
Copy link

@MrKragh MrKragh commented Jan 1, 2024

Hi there!

Thank you for this awesome project! I'm kind of lazy in terms of pleasing light/dark modes, and usually try to fix with a transparent background, and seemed like I could do that for my own Github Person page.

Anyhow, just wanted to contribute back so here is a PR.

To use add in the following to the JSON. "backgroundOpacity": 0.0 to make totally transparent and "backgroundOpacity": 1.0 is solid.

I know nothing about TypeScript , just call me Jon Snow! Hope I did it right by your standards and the PR makes sense.

@@ -732,6 +740,7 @@ const create3DContrib = (svg, userInfo, x, y, width, height, settings, isForcedA
const week = Math.floor(diffDate(startTime, cal.date.getTime()) / 7);
const baseX = offsetX + (week - dayOfWeek) * dx;
const baseY = offsetY + (week + dayOfWeek) * dy;
// ref. https://github.com/yoshi389111/github-profile-3d-contrib/issues/27
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't ask me how this occurred! I suspect my IDE playing a trick on me here! Sorry!

@yoshi389111
Copy link
Owner

@MrKragh
Thank you for your pull request.

I understand that you want to set transparency as the background color when using custom json file by specifying the SETTING_JSON environment variable.

In fact, even in the current version, you can specify a color with transparency, for example by doing the following.

 {
   "type": "normal",
   "fileName": "profile-custom-evergreen.svg",
-  "backgroundColor": "#ffffff",
+  "backgroundColor": "rgba(255,255,255,0.3)",
   "foregroundColor": "#00000f",
   "strongColor": "#111133",
   "weakColor": "gray",
   "radarColor": "#47a042",
   "growingAnimation": true,
   "contribColors": [
     "#efefef",
     "#d8e887",
     "#8cc569",
     "#47a042",
     "#1d6a23"
   ]
 }

Also, I think that adding backgroundOpacity as a required field would have a significant impact on people who are already using custom json file.
Of course, it could be made optional.
But I think adding backgroundOpacity is unnecessary at this time.

If you have any other suggestions, please feel free to send us a pull request. Thank you.

@yoshi389111 yoshi389111 closed this Mar 7, 2025
@yoshi389111
Copy link
Owner

I thought there might be other people who want a transparent background but don't realize that it's possible.

If you don't mind, could you resubmit the merge request without the source code modifications and with a custom JSON file with a transparent background in sample-settings/?

That way, it will be easier for users to notice that a transparent background is possible.

Thank you in advance.

@yoshi389111 yoshi389111 reopened this Mar 8, 2025
@yoshi389111 yoshi389111 self-assigned this Mar 11, 2025
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 this pull request may close these issues.

2 participants