Skip to content

Enhancing readability, making code more compact, and reducing chances of redundancy. #233

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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions generative-art-opensource
Submodule generative-art-opensource added at ed8a37
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@ const signImage = (_sig) => {
ctx.fillText(_sig, 40, 40);
};

// generate a random color hue
const genColor = () => {
let hue = Math.floor(Math.random() * 360);
let pastel = `hsl(${hue}, 100%, 85%)`;
return pastel;
};

// generate a random color hue inside method for better readability
const drawBackground = () => {
ctx.fillStyle = genColor();
ctx.fillStyle ='hsl(' + 360 * Math.random() + ', 100%, 85%)';
ctx.fillRect(0, 0, width, height);
};

Expand Down
3 changes: 2 additions & 1 deletion input/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ const editionDnaPrefix = 0

// create required weights
// for each weight, call 'addRarity' with the id and from which to which element this rarity should be applied
// changed value of orginial rarity weight to 6 instead of 5 to reduce repepititve outcomes of outcomes between rare and original
let rarityWeights = [
addRarity('super_rare', 1, 1),
addRarity('rare', 2, 5),
addRarity('original', 5, 10)
addRarity('original', 6, 10)
];

// create required layers
Expand Down