<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 30, 2017, at 3:52 PM, Dave DeLong <<a href="mailto:swift@davedelong.com" class="">swift@davedelong.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">What is the useful distinction between generating a random value, and choosing a random element from a collection of all possible values?</span></div></blockquote></div><br class=""><div class="">I don’t have to generate (or keep in memory) that collection. </div><div class=""><br class=""></div><div class="">I gave an example before of an easy to add API for random colors which allow their saturation, lightness, and alpha to be fixed. I use something very similar all the time in some graphics code I have (varying only the hue or saturation). I also do the same with Sizes and CGVectors. How would you represent that as a collection to choose an element from?</div><div class=""><br class=""></div><div class="">Also, for most of my use cases, I *need* to be able to plug in a repeatably random source… otherwise pixels will start jumping around the screen when people resize things.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon</div></body></html>