Closed nils-van-zuijlen closed 10 months ago
I think the reason was that it really isn't advisable to do the conversion in the write function, except for very fast microcontrollers. In most (i think all) implementations the iterator has to yield in under 1 μs, especially to conform to the datasheet, so doing it just in time is usually way to slow. Having it separate encourages doing the transformation beforehand.
Thank you, sounds sensible.
Could it be explained in the documentation or README then ?
Why is the hsv to rgb conversion handled by the
hsv2rgb
function and not by an implementation of theInto<RGB8>
trait ?It would mean that we can use it directly in
write
function ofSmartLedsWrite
, which would be really useful.https://github.com/smart-leds-rs/smart-leds-trait/blob/2a082914382fc63e07681c8df28c13fc4dd72f21/src/lib.rs#L13