function getBlackOrWhite(theString)
{
	if(theString.length == 7){
		theString = theString.substr(1, 6);
	}
	if(theString.length != 6){
		return '#FFFFF1';
	}
	
	a=theString.slice(0,2);
	b=theString.slice(2,4);
	c=theString.slice(4,6);
	a1=16*giveHex(a.slice(0,1));
	a2=giveHex(a.slice(1,2));
	a=a1+a2;
	b1=16*giveHex(b.slice(0,1));
	b2=giveHex(b.slice(1,2));
	b=b1+b2;
	c1=16*giveHex(c.slice(0,1));
	c2=giveHex(c.slice(1,2));
	c=c1+c2;

	// Change the number 160 to adjust sensitivity
	if (c>160){ newColor='black' }
	else { newColor='white' };

	return newColor;

}
var hexbase="0123456789ABCDEF";
function DecToHex(number) {
	return( hexbase.charAt((number>> 4)& 0xf)+ hexbase.charAt(number& 0xf));
}

function giveHex(s){
	s=s.toUpperCase();
	return parseInt(s,16);
}