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

fix(image): dataUri is not random #2316

Merged
merged 23 commits into from
Sep 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/modules/image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,16 @@ export class ImageModule {
*/
height?: number;
/**
* The color of the image.
* The color of the image. Must be a color supported by svg. Defaults to a random color.
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
OmkarPednekar marked this conversation as resolved.
Show resolved Hide resolved
*
* @default 'random color'
*/
color?: string;
} = {}
): string {
const {
width = 640,
height = 480,
color = this.faker.color.rgb({ prefix: '#' }),
color = this.faker.color.rgb(),
} = options;

const svgString = `<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full" width="${width}" height="${height}"><rect width="100%" height="100%" fill="${color}"/><text x="${
Expand Down