1function nativeColor(elm) {
4 if (c[4] === 1) { return 'rgb(' + c[1] + ',' + c[2] + ',' + c[3] + ')'; }
5 return 'rgba(' + c[1] + ',' + c[2] + ',' + c[3] + ',' + c[4] + ')';
7function complement(rgb) {
9 hsv.hue = (hsv.hue + 180) % 360;
13function hsva(h) { return function(s) { return function(v) { return function(a) {
14 var clr = toRGB({hue:h, saturation:s, value:v});
20function hsv(h) { return function(s) { return function(v) {
21 return toRGB({hue:h, saturation:s, value:v}); }; }; }
25 var r = rgb[1] / 255.0, g = rgb[2] / 255.0, b = rgb[3] / 255.0;
26 var M = Math.max(r,g,b);
27 var m = Math.min(r,g,b);
31 if (c === 0) { h = 0; }
32 else if (M === r) { h = ((g - b) / c) % 6; }
33 else if (M === g) { h = ((b - r) / c) + 2; }
34 else if (M === b) { h = ((r - g) / c) + 4; }
37 return { value : M, hue : h, saturation : (M === 0 ? 0 : c / M) };
40function between(lo,hi,x) { return lo <= x && x < hi; }
41function norm(n) { return Math.round(n*255); }
44 var c = hsv.value * hsv.saturation;
45 var hue = hsv.hue / 60;
46 var x = c * (1 - Math.abs((hue % 2) - 1));
47 var r = 0, g = 0, b = 0;
48 if (between(0,1,hue)) { r = c; g = x; b = 0; }
49 else if (between(1,2,hue)) { r = x; g = c; b = 0; }
50 else if (between(2,3,hue)) { r = 0; g = c; b = x; }
51 else if (between(3,4,hue)) { r = 0; g = x; b = c; }
52 else if (between(4,5,hue)) { r = x; g = 0; b = c; }
53 else if (between(5,6,hue)) { r = c; g = 0; b = x; }
55 var m = hsv.value - c;
56 return [ "Color", norm(r+m), norm(g+m), norm(b+m), 1 ];
62 complement:complement,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list