diff --git a/frontend/js/ng.js b/frontend/js/ng.js index 835769bf..ab2d6b39 100644 --- a/frontend/js/ng.js +++ b/frontend/js/ng.js @@ -352,7 +352,14 @@ default: return ""; } - } + }; + + $scope.oppositeColour = function(colour) { + var d1 = parseInt(colour.substr(0, 2), 16); + var d2 = parseInt(colour.substr(2, 2), 16); + var d3 = parseInt(colour.substr(4, 2), 16); + return ((d1+d2+d3)/3 <= 64) ? "ffffff" : "000000"; + }; }); function bindSocketToScope($scope, socket) { diff --git a/frontend/pad.css b/frontend/pad.css index 429faf0e..f2a9c202 100644 --- a/frontend/pad.css +++ b/frontend/pad.css @@ -198,4 +198,8 @@ textarea { .pos,.distance { font-style: italic; +} + +#edit-line-colour { + width: auto; } \ No newline at end of file diff --git a/frontend/pad.html b/frontend/pad.html index 76d53fce..a1bbad22 100644 --- a/frontend/pad.html +++ b/frontend/pad.html @@ -120,6 +120,9 @@ +
+ +