TAG | language
This JavaScript function provides a simple script to generate a random HEX colour code that can be used on any DOM element. A simple call to the function “genHEX()” will return a 6 character string that changes everytime. This is useful if you want an element to be a different colour on each page load.
The Code
Below is the code, documentation is in the form of comments in the code.
function genHex(){
// Make a new array with all available HEX options.
var colours = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
// Make variable to hold 6 character HEX array
digit = new Array(5);
colour="";
for (i=0;i<6;i++){
// Loop through 6 times, randomising the letter added to the array
digit[i]=colours[Math.round(Math.random()*14)];
colour = colour+digit[i];
}
// Returns like "a10bc5". It is likely that you may need to add a "#".
return colour;
}
code · free · javascript · language
Yes! We love doing things “out of the norm”. Every one of our team is an experienced software developer. We specialise in both Online and Offline programming however we found the majority of our business was coming from web design so we tailored our business to suit.
We are happy to provide quotes for desktop software, we can create bespoke applications or full corporate suites, we have even been known to develop “similar products” to others on the market as are generally cheaper.
Our desktop software programming expertise includes:
- VB6
- VB .NET
- C#
- C
- C++
- Java (Including embedded devices)
- Mobile Device languages including iPhone, Symbian and Android
- Python
We will choose a programming language to suit your needs. So far, this is most commonly VB.NET or Java.
We have released several commercial products including (but not limited to) the commission management tool for Land of Leather, POS systems for restaurants, and order management tools for our Reflux web package,
expertise · faq · language · programming · question · software · technology

