diff --git a/js/constants/colors.js b/js/constants/colors.js new file mode 100644 index 0000000..41eda43 --- /dev/null +++ b/js/constants/colors.js @@ -0,0 +1,16 @@ +var head = { + brick: [0, 62, 53], + yellow: [48, 100, 64] +} +var bg = { + forest: '#006375', + green: '#63D6A3', + blue: '#358EFF', + salmon: '#FF9B7A', + coral: '#F96854', +} + +module.exports = { + head: head, + bg: bg +}; diff --git a/js/fox.js b/js/fox.js index 7ff2ae9..a249124 100644 --- a/js/fox.js +++ b/js/fox.js @@ -1,4 +1,5 @@ const Chance = require('chance'); +const colors = require('./constants/colors.js'); const hsl = function (h, s, l) { return "hsl(" + h + "," + s + "%, " + l + "%)"; @@ -14,15 +15,22 @@ const Fox = function (IMG_WIDTH, IMG_HEIGHT, seed) { // origin: head top left corner const kappa = chance.floating({min: 0.2, max: 0.45}) - const hue = chance.integer({min: 5, max: 50}); - const saturation = chance.integer({min: 70, max: 90}); - const lightness = chance.integer({min: 40, max: 60}); + const headColor = (function () { + const level = chance.floating({min: 0, max: 1}); + const result = []; + const min = colors.head.brick; + const max = colors.head.yellow; + for (let i=0; i