Skip to content

Commit

Permalink
Add colors.js example + info to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Oct 17, 2017
1 parent febb51a commit bbbf526
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

Make sure you have the needed usb lib requirements for your OS.

This project now supports full RGB/hex colors.

Generic Linux: `libusb-dev` `libusb-1.0-0-dev`

Expand Down Expand Up @@ -107,22 +108,13 @@ Colors must be set before using keyboard.blink();

They will not affect hardware-default modes such as Wave and Breathing.

The following colors are defined:

black
red
orange
yellow
green
cyan
blue
purple
white
All colors supported by [Colors.js](https://github.com/Marak/colors.js) are now supported here

To set a color use keyboard.colors() There are two ways to set the color to a region:
```javascript
keyboard.color('middle', 'green');
keyboard.color('middle', {color:'green', intensity:'high'});
keyboard.color('middle', {color:'#ffffff', intensity:'high'});
keyboard.color('middle', {color:'#4654BD', intensity:'high'});
```


Expand All @@ -142,7 +134,7 @@ To set it:

```javascript
keyboard.color('right', {
color: 'blue',
color: '#1CA626',
intensity: 'med', // light, low, med, high
});
```
Expand Down
4 changes: 2 additions & 2 deletions examples/color.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var keyboard = require('../')();

keyboard.color('left', {
color: 'red',
color: 'rgba(200, 0, 0)',
intensity: 'high'
});
keyboard.color('middle', {
color: 'green',
intensity: 'high'
});
keyboard.color('right', {
color: 'blue',
color: '#4654BD',
intensity: 'high'
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"author": "Steve Lacy <me@slacy.me> (http://slacy.me)",
"main": "./index.js",
"dependencies": {
"node-hid": "*"
"color": "^2.0.0",
"node-hid": "^0.5.7"
},
"devDependencies": {
"mocha": "*",
Expand Down

0 comments on commit bbbf526

Please sign in to comment.