MicroPython Cookbook
上QQ阅读APP看书,第一时间看更新

Setting an LED color using color names

Using human-readable color names can make it much easier to keep track of what colors are in use in your application. This recipe demonstrates a technique that allows you to set pixel colors using regular color names. This feature of referring to colors by a standard set of color names is available in popular languages, including CSS. This recipe shows you how to bring this feature to your MicroPython scripts.