> On Jan 10, 2018, at 4:42 PM, Nate Cook <natec...@apple.com> wrote:
> 
> I don’t see how a single distribution would generate both integers and 
> colors. Can your color type be initialized from an integer? Since the 
> “distributions” in that playground are just sequences, you could add 
> .lazy.map({ Color(value: $0) }) to transform an integer-producing 
> distribution into a color-producing one. (Which is pretty cool, tbh.)

See my other email for details, but it is essentially initialized from a 
sequence of 2-4 UInt* (one for each axis).  I usually fix all but one dimension 
for aesthetic reasons though, so yes-ish**.

Thanks,
Jon

* I do mean UInt, and not UInt32 or UInt64. The amount of randomness it grabs 
is based on the word size of the platform, since CGFloats are as well.

** It currently naively still burns 2-4 UInt worth of randomness even if the 
axises are fixed, but it is ignoring 1-3 of the numbers in that case and only 
really using 1.  I could easily optimize this without changing the interface 
though.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to