How to Make Colors With Ruby and Bitwise Operations
17-Oct-2019 1823
Leverage softPwn on the Raspberry Pi to control a mutli-colored LED with Ruby hexadecimal primitives, and some bitwise operations.The RGB LED I'm working with has four pins. Three of these pins take input that control the brightness level for (R)ed, (G)reen, and (B)lue. This allows us to take advantage of the additive color system to create all kinds of colors by supplying different proportions of these three types of light (e.g. fully bright red and fully bright blue will appear purple).Our Problem: How can we easily store color values in RGB format as a percentage of luminance?.
How to Make Colors With Ruby and Bitwise Operations #ruby #rubydeveloper #rubyonrails #Colors #Bitwise #Operations https://www.rubyonrails.ba/link/how-to-make-colors-with-ruby-and-bitwise-operations