Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
com.github.afkbrb:github-avatar-generator
Advanced tools
Generate github-style avatar with java awt.
This project was inspired by gabrie-allaigre/avatar-generator.
The artifact has been released to center maven, simply add dependency.
<dependency>
<groupId>com.github.afkbrb</groupId>
<artifactId>github-avatar-generator</artifactId>
<version>1.0.0</version>
</dependency>
Method | Description | Default |
---|---|---|
setPadding(int padding) | Set the padding of the avatar. | 32 |
setCellCount(int cellCount) | Set the number of cells of the avatar. | 5 |
setCellSize(int cellSize) | Set the size of each cell, both length and height of each cell will be set to it. | 64 |
setForeColor(Color color) | Set the foreground color of the avatar. | random |
setForeColors(Color... colors) | Set the foreground color set, the final foreground color will be chosen at random in it. | random |
setForeColors(List colors) | Set the foreground color set, the final foreground color will be chosen at random in it. | random |
setTransparent(boolean transparent) | Set the transparency of the avatar. | false |
setBackColor(Color color) | Set the background color of the avatar. | Color(241, 241, 241) |
Notice
The final foreground color will be decided by the last called setForeColor* method. And if none of these setForeColor* methods are called, the foreground color will be generated at random but will also meet certain conditions to make the color look nice.
Method | Description |
---|---|
void build() | Build the avatar, calling the method each time will create a new avatar image at random according to configuration. |
BufferedImage generateAndGetAvatar() | Generate a new avatar image and return it. |
void showAvatar() | Show the generated avatar image with local application. |
void saveAsPNG(String filepath) | Save avatar image as PNG file. The filepath include path and filename, for example, "E:/avatar.png", you should make sure that the path exists. |
Default
Avatar avatar = new Avatar();
avatar.showAvatar();
Save
Avatar avatar = new Avatar();
avatar.saveAsPNG("E:/avatar.png");
Set padding and cell size
AvatarConfig config = new AvatarConfig();
config.setPadding(16);
config.setCellSize(32);
Avatar avatar = new Avatar(config);
avatar.showAvatar();
Set the number of cells per row / column
config.setCellCount(8);
Set transparency
config.setTransparent(true);
Set color
config.setForeColor(Color.MAGENTA);
// config.setBackColor(Color.LIGHT_GRAY);
Set colors
config.setForeColors(Color.MAGENTA, Color.BLUE, Color.GREEN);
// the other way
List<Color> colors = new ArrayList<>();
colors.add(Color.YELLOW);
colors.add(Color.ORANGE);
colors.add(Color.CYAN);
config.setForeColors(colors);
For more example details, see example.
FAQs
Tool for generating github-style avatars.
We found that com.github.afkbrb:github-avatar-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.