[PATCH] hgweb: remove unused colorPart() from mercurial.js
Augie Fackler
raf at durin42.com
Thu Nov 5 08:39:14 CST 2015
On Wed, Nov 04, 2015 at 01:52:46PM +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6 at dwimlabs.net>
> # Date 1445676453 -3600
> # Sat Oct 24 09:47:33 2015 +0100
> # Node ID 63616938cd2f05480c32d068484e91665b91b025
> # Parent 859f453e8b4e2b42b6b6552b79c5c5e7e2fc1cf7
> hgweb: remove unused colorPart() from mercurial.js
Queued, thanks!
>
> 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.
>
> diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js
> --- a/mercurial/templates/static/mercurial.js
> +++ b/mercurial/templates/static/mercurial.js
> @@ -50,18 +50,6 @@ function Graph() {
> this.cell_height = this.box_size;
> }
>
> - function colorPart(num) {
> - num *= 255
> - num = num < 0 ? 0 : num;
> - num = num > 255 ? 255 : num;
> - var digits = Math.round(num).toString(16);
> - if (num < 16) {
> - return '0' + digits;
> - } else {
> - return digits;
> - }
> - }
> -
> this.setColor = function(color, bg, fg) {
>
> // Set the colour.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list