Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function mutate(low, high){
  2. var item = Math.floor(Math.random()*(high - low) + low)
  3. return item
  4. }
  5.  
  6. function getLowestMutationColors(colorFraction){
  7. var newColorFraction = Math.floor(colorFraction - 255*mutation)
  8. if(newColorFraction < 0){
  9. newColorFraction = 0
  10. }
  11. return newColorFraction
  12. }
  13.  
  14. function getHighestMutationColors(colorFraction){
  15. var newColorFraction = Math.floor(colorFraction + 255*mutation)
  16. if(newColorFraction > 255){
  17. newColorFraction = 255
  18. }
  19. return newColorFraction
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement