This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.replaceTargetColour = function (target_colour, repleacement_colours) { | |
var replaceColour = function(file, enc, callback) { | |
if (file.IsNull) { | |
return callback(null, file); | |
} | |
function replaceColour() { | |
if (file.isStream()) { | |
file.contents = file.contents.pipe(replace(target_colour, repleacement_colours)); | |
return callback(null, file); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var colours = [ | |
{ colour: 'white', value: '#ffffff' }, | |
{ colour: 'black', value: '#182124' }, | |
{ colour: 'yellow', value: '#efbd46' }, | |
{ colour: 'blue', value: [ | |
{ colour: 'navy', value:'#223157' }, | |
{ colour: 'dark', value:'#016ca6' }, | |
{ colour: 'flat', value:'#52a1cc' }, | |
{ colour: 'slate', value:'#8fb7cc' }, | |
{ colour: 'sky', value:'#50c1e9' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a string which represents the current temperature | |
* @return {String} Text ready for the katification matrix | |
*/ | |
getTemperatureText(temperature) { | |
const keyText = findLastKey(weatherConfig.temperature, (keyTemperature) => { | |
let normalizedTemp = Math.max(weatherConfig.temperatureMin, temperature); | |
normalizedTemp = Math.min(weatherConfig.temperatureMax, normalizedTemp); | |
return normalizedTemp >= keyTemperature; |