Mercurial > hg
comparison mercurial/templates/static/mercurial.js @ 26867:ad443e8d9334
hgweb: remove unused colorPart() from mercurial.js
Looks like the function wasn't ever used since its introduction in
0dba955c2636, since setColor() below always used "rgb(255, 255, 255)" notation
which doesn't need hex digits.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 24 Oct 2015 09:47:33 +0100 |
parents | 3ed635cb108e |
children | 1779ff7426c9 |
comparison
equal
deleted
inserted
replaced
26866:0f75461a9698 | 26867:ad443e8d9334 |
---|---|
46 | 46 |
47 this.scale = function(height) { | 47 this.scale = function(height) { |
48 this.bg_height = height; | 48 this.bg_height = height; |
49 this.box_size = Math.floor(this.bg_height / 1.2); | 49 this.box_size = Math.floor(this.bg_height / 1.2); |
50 this.cell_height = this.box_size; | 50 this.cell_height = this.box_size; |
51 } | |
52 | |
53 function colorPart(num) { | |
54 num *= 255 | |
55 num = num < 0 ? 0 : num; | |
56 num = num > 255 ? 255 : num; | |
57 var digits = Math.round(num).toString(16); | |
58 if (num < 16) { | |
59 return '0' + digits; | |
60 } else { | |
61 return digits; | |
62 } | |
63 } | 51 } |
64 | 52 |
65 this.setColor = function(color, bg, fg) { | 53 this.setColor = function(color, bg, fg) { |
66 | 54 |
67 // Set the colour. | 55 // Set the colour. |