Following are the conversion formulas from RGB to YUV and from YUV to RGB. See YUV and color space conversion. From RGB to YUV Y = 0.299R + 0.587G + 0.114B U = 0.492 (B-Y) V = 0.877 (R-Y ...
The brains of this thing is an ESP8266 on a custom PCB which controls the 127 individually addressable RGB LEDs. The clock may look large, but the big printed parts just fit on the bed of a Prusa i3.