{"payload":{"allShortcutsEnabled":false,"fileTree":{"NeoPixel":{"items":[{"name":"morse","path":"NeoPixel/morse","contentType":"directory"},{"name":"rainbow_crazy","path":"NeoPixel/rainbow_crazy","contentType":"directory"},{"name":"rainbow_rotate","path":"NeoPixel/rainbow_rotate","contentType":"directory"},{"name":"random_all","path":"NeoPixel/random_all","contentType":"directory"},{"name":"random_appear","path":"NeoPixel/random_appear","contentType":"directory"},{"name":"random_flip","path":"NeoPixel/random_flip","contentType":"directory"},{"name":"random_raw","path":"NeoPixel/random_raw","contentType":"directory"},{"name":"random_rotate","path":"NeoPixel/random_rotate","contentType":"directory"},{"name":"random_same","path":"NeoPixel/random_same","contentType":"directory"},{"name":"random_some","path":"NeoPixel/random_some","contentType":"directory"},{"name":"color-wheel.py","path":"NeoPixel/color-wheel.py","contentType":"file"}],"totalCount":11},"":{"items":[{"name":"NeoPixel","path":"NeoPixel","contentType":"directory"},{"name":"Wearables","path":"Wearables","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"}],"totalCount":4}},"fileTreeProcessingTime":8.136754,"foldersToFetch":[],"repo":{"id":52229787,"defaultBranch":"master","name":"bits-bytes-and-lights","ownerLogin":"aronatkins","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2016-02-21T21:47:52.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/362187?v=4","public":true,"private":false,"isOrgOwned":false},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"2498dcf3472732ed5761af9fce068ee77b4fd8de","listCacheKey":"v0:1456091302.0","canEdit":false,"refType":"tree","currentOid":"2498dcf3472732ed5761af9fce068ee77b4fd8de"},"path":"NeoPixel/color-wheel.py","currentUser":null,"blob":{"rawLines":["#!/usr/bin/python","#","# A python program which builds a table showing the transformations performed","# by the Wheel function that is part of the strandtest example included within","# the NeoPixel library.","#","# References:","# https://github.com/adafruit/Adafruit_NeoPixel/blob/be0d7706e196dd8479e4573038785bad0b1e6726/examples/strandtest/strandtest.ino","# https://github.com/adafruit/Adafruit_NeoPixel/tree/be0d7706e196dd8479e4573038785bad0b1e6726/examples/strandtest","# https://github.com/adafruit/Adafruit_NeoPixel","","def wheel(position) :"," \"\"\""," reimplementation of Wheel in python. returns a rgb triple instead of"," converting to a 32-bit value."," \"\"\""," position = 255 - position"," if position < 85:"," return (255 - position * 3, 0, position * 3)"," if position < 170:"," position = position - 85"," return (0, position * 3, 255 - position * 3)"," position = position - 170"," return (position * 3, 255 - position * 3, 0)","","def color32(rgb) :"," \"\"\""," reimplementation of Adafruit_NeoPixel::Color, taking an rgb triple and"," returning a 32-bit number (the top eight bits are unused here)."," \"\"\""," (r,g,b) = rgb"," return (r << 16) | (g << 8) | b","","","def make_table(positions) :"," reds = []"," greens = []"," blues = []"," colors = []",""," for position in positions:"," rgb = wheel(position)"," c = color32(rgb)",""," reds.append(rgb[0])"," greens.append(rgb[1])"," blues.append(rgb[2])"," colors.append(c)",""," print \"
\""," print \"