diff --git a/html/config.js b/html/config.js index 2346f55..a1c01bb 100644 --- a/html/config.js +++ b/html/config.js @@ -72,10 +72,9 @@ //lineWidth = 1; -// 0 to 100 to set a brightness for and enable monochrome aircraft markers / tracks -// -1 to use colored markers / tracks (default) -//monochromeMarkers = -1; -//monochromeTracks = -1; +// constant html color for markers / tracks +//monochromeMarkers = "#FFFFFF"; +//monochromeTracks = "#000000"; // These settings control the coloring of aircraft by altitude. // All color values are given as Hue (0-359) / Saturation (0-100) / Lightness (0-100) diff --git a/html/defaults.js b/html/defaults.js index cdbd530..09bc15a 100644 --- a/html/defaults.js +++ b/html/defaults.js @@ -63,10 +63,9 @@ var largeMode = 1; var lineWidth = 1; -// 0 to 100 to set a brightness for and enable monochrome aircraft markers / tracks -// -1 to use colored markers / tracks (default) -var monochromeMarkers = -1; -var monochromeTracks = -1; +// constant html color for markers / tracks +var monochromeMarkers = null; +var monochromeTracks = null; // These settings control the coloring of aircraft by altitude. // All color values are given as Hue (0-359) / Saturation (0-100) / Lightness (0-100) diff --git a/html/planeObject.js b/html/planeObject.js index e03c145..823796b 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -551,6 +551,9 @@ PlaneObject.prototype.getMarkerColor = function() { if (this.squawk in SpecialSquawks) return SpecialSquawks[this.squawk].markerColor; + if (monochromeMarkers) { + return monochromeMarkers; + } var h, s, l; @@ -560,11 +563,6 @@ PlaneObject.prototype.getMarkerColor = function() { s = colorArr[1]; l = colorArr[2]; - if (monochromeMarkers >= 0) { - s = 0; - l = monochromeMarkers; - } - // If we have not seen a recent position update, change color if (this.seen_pos > 15 && !globeIndex) { h += ColorByAlt.stale.h; @@ -1363,11 +1361,10 @@ PlaneObject.prototype.altitudeLines = function(segment) { colorArr = [colorArr[0], colorArr[1], colorArr[2] * 0.7]; //var color = 'hsl(' + colorArr[0].toFixed(0) + ', ' + colorArr[1].toFixed(0) + '%, ' + colorArr[2].toFixed(0) + '%)'; - if (monochromeTracks >= 0) - colorArr = [colorArr[0], 0, monochromeTracks]; - var color = hslToRgb(colorArr[0], colorArr[1], colorArr[2]); + if (monochromeTracks) + color = monochromeTracks; const lineKey = color + '_' + debugTracks + '_' + noVanish + '_' + segment.estimated + '_' + newWidth; diff --git a/html/script.js b/html/script.js index e3f89ab..f23eefa 100644 --- a/html/script.js +++ b/html/script.js @@ -540,16 +540,30 @@ function initialize() { try { const search = new URLSearchParams(window.location.search); - if (search.get('monochromeTracks') != undefined) { - monochromeTracks = parseInt(search.get('monochromeTracks')); - if (isNaN(monochromeTracks) || !(monochromeTracks >= 0 && monochromeTracks <= 100)) - monochromeTracks = 5; + var tracks = search.get('monochromeTracks'); + if (tracks != undefined) { + if (tracks.length == 6) + monochromeTracks = '#' + tracks; + else + monochromeTracks = "#000000"; } - if (search.get('monochromeMarkers') != undefined) { - monochromeMarkers = parseInt(search.get('monochromeMarkers')); - if (isNaN(monochromeMarkers) || !(monochromeMarkers >= 0 && monochromeMarkers <= 100)) - monochromeMarkers = 95; + + var markers = search.get('monochromeMarkers'); + if (markers != undefined) { + if (markers.length == 6) + monochromeMarkers = '#' + markers; + else + monochromeMarkers = "#FFFFFF"; } + + var outlineColor = search.get('outlineColor'); + if (outlineColor != undefined) { + if (markers.length == 6) + OutlineADSBColor = '#' + outlineColor; + else + OutlineADSBColor = "#000000"; + } + if (search.get('largeMode') != undefined) { var tmp = parseInt(search.get('largeMode')); console.log(tmp);