Sav2907,
как вариант ...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var d = document.querySelectorAll("tr td:nth-child(1)");
var bgcolors = ["1628B7", "B14B0B", "99C3C1"];
function inv(r)
{
return (parseInt(r, 16) ^ 0xFFFFFF | 0x1000000).toString(16).substring(1);
}
[].reduce.call(d, function(b, c) {
var a = c.textContent,
a = b[a] || (b[a] = bgcolors.pop() || "0000FF");
c.parentNode.style.backgroundColor = "#"+a;
c.parentNode.style.color = "#"+inv(a);
return b
}, {})
});
</script>
</head>
<body>
<table>
<tr><td>111</td><td>fsdfwe</td><td>asfasfasf</td></tr>
<tr><td>111</td><td>dfgdfg</td><td>asdfasfsfd</td></tr>
<tr><td>fff</td><td>fsdfwe</td><td>asfasfasf</td></tr>
<tr><td>111</td><td>fdsfsdf</td><td>kjhkhjk</td></tr>
<tr><td>fff</td><td>fsdfwe</td><td>asfasfasf</td></tr>
<tr><td>fff</td><td>6hy56</td><td>h56h56</td></tr>
<tr><td>ttt</td><td>6hy56</td><td>h56h56</td></tr>
<tr><td>ttt</td><td>ytutyu</td><td>32r23r</td></tr>
</table>
</body>
</html>