Skip to content

Commit 9f4decd

Browse files
committed
added helper function rgbToFullColorHsv()
1 parent 9648200 commit 9f4decd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ module.exports = {
4444
return (256 + 176 - Math.floor(Number(hsv[0]) / 360.0 * 255.0)) % 256;
4545
},
4646

47+
rgbToFullColorHsv: function rgbToFullColorHsv(r, g, b) {
48+
var hsv = this.rgbToHsv(r, g, b);
49+
hsv[0] = (hsv[0] == 0)?0xB0:hsv[0] * 0xFF % 0x167;
50+
return hsv;
51+
},
52+
4753
buffer2hex: function buffer2hex(buffer) {
4854
var result = [];
4955
for (var i = 0; i < buffer.length; i++) {

0 commit comments

Comments
 (0)