d3.js barCharts for displaying data with the added randomData function also the relative luminance algorithm, So the text is always visible relative luminance algorithm will change the color of the text in each random generated bar based on the color of each bar.
The relativeLumance algorithm will measure the hex value to check if it is on the lower or higher end of the luminance scale and will make the text change to white if the color is on the darker end of the scale and vice versa the color of the bar on the lighter end will make the algorithm turn the text inside the bar to black its a very useful function and everyone should use it when it comes to displaying random colors on a Element that you also wish to have text on this will make sure its always visible pretty cool I wish I remember the guys name who taught me it thanks.