Skip to content

Commit

Permalink
Merge pull request #139 from AE-archive/master
Browse files Browse the repository at this point in the history
Fixing unstable generation from the same seed
  • Loading branch information
davidmerfield authored Aug 9, 2023
2 parents 3b8a7f4 + fb0d329 commit 5926f05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions randomColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default function randomColor (options) {

options = options || {};

// If reset flag is true, set colorRanges to [].
if (options.reset !== undefined && options.reset !== null && options.reset === true) {
colorRanges = [];
}

// Check if there is a seed and ensure it's an
// integer. Otherwise, reset the seed value.
if (options.seed !== undefined && options.seed !== null && options.seed === parseInt(options.seed, 10)) {
Expand Down

0 comments on commit 5926f05

Please sign in to comment.