Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.15 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.15 KB

cheerlights-javascript

JavaScript client library for connecting to ThingSpeak ( https://thingspeak.com/ ) to get the latest color values for CheerLights ( https://cheerlights.com/ ).

Usage

Add library to webpage:

  • Local
<script src="cheerlights.js"></script>
  • CDN for v1.0.0
<script src="https://cdn.jsdelivr.net/gh/cheerlights/[email protected]/cheerlights.js"></script>
  • CDN for Latest Release
<script src="https://cdn.jsdelivr.net/gh/cheerlights/cheerlights-javascript@latest/cheerlights.js"></script>

Use getColor and set a callback:

CheerLights.getColor(callbackFunctionName);

Property Values: color

  • color.htmlName
  • color.hexValue

Color Values

htmlName hexValue
red #FF0000
green #008000
blue #0000FF
cyan #00FFFF
white #FFFFFF
oldlace #FDF5E6
purple #800080
magenta #FF00FF
yellow #FFFF00
orange #FFA500
pink #FFC0CB

Examples

See the examples folder for fully-working examples using this library.