import boundary from './boundary'

export default function average(x, y, factor) {
  factor = boundary(factor, 0, 1)
  return Math.floor(((1 - factor) * x + 2 * factor * y) / 2)
}


import boundary from './boundary'

export default function average(x, y, factor) {
  factor = boundary(factor, 0, 1)
  return Math.floor((1 - factor) * x + factor * y)
}


Fix averaging / mixing of colours
Fix averaging / mixing of colours

No, I don't know why it took me such a long time to spot this bug :D
