Would you just like these text boxes to be filled with hex values upon loading of the page or upon each change of the color? If you understand javascript, you may be farmiliar with "setInterval" that would check for its background color every x milliseconds. Do you have a website or an example page online? If not, could you please post the code here so that we can use it for a template?
Sorry for all of the questions, but also, would you like for the javascript to get the background color of an element on the webpage (if it has a certain class, it would be getting the background color from the element and that element's background color would be coming from the css class or #id), or do you want the javascript to get the background color through raw css? I do not think that it can be accessed through RAW css, though I would suppose that just finding the background color of an element on the webpage that could have a special class would be getting the background color of that special class.
To achieve this seemingly hard feat, yet is in truth simpler than hard, we would create a function that would access an element's styles. I'll make it easy for you, which I should as a default, but I'm usually lazy...
You can edit the code easily if you don't get javascript very well, which if you don't, I highly suggest you check here for a simple tutorial. Let's begin:
We'll start with the setInterval function. I think we should give a variable the set interval function, x perhaps, like so:
Code:
var x = setInterval(/* css checking function here */, /* interval here */);
Now let's make the interval variable. We'll call it i:
Code:
var i = 5; // interval in seconds
Replace the highlighted 5 with any number of seconds you want for the background color to be checked. After we make an interval, we should make a function. We can assign a variable a function easily. This variable will be used in setInterval to do the actual checking of the element work. We'll name this variable f:
Code:
var f = function(mid, cid) { // function parameters: { mid: textbox id, cid: cell/element id }
var el1 = document.getElementById(mid);
var el2 = document.getElementById(cid);
var colorArr = [
["aqua", "#00FFFF"],
["black", "#000000"],
["blue", "#0000FF"],
["fuchsia", "#FF00FF"],
["gray", "#808080"],
["green", "#008000"],
["lime", "#00FF00"],
["maroon", "#800000"],
["navy", "#000080"],
["olive", "#808000"],
["purple", "#800080"],
["red", "#FF0000"],
["silver", "#C0C0C0"],
["teal", "#008080"],
["white", "#FFFFFF"],
["yellow", "#FFFF00"]
];
for(i = 0; i < colorArr.length; i++) {
if(el2.style.backgroundColor.toLowerCase() == colorArr[i][0]) { // checks for color name
el1.value = colorArr[i][1]; // sets value in textbox
return; // exits function
}
}
el1.value = el2.style.backgroundColor;
};
Defined are the 16 base colors in HTML. There is no other way to convert color names into hex, so I just made an array instead. There are too css many colors for me to apply to the color array right now (it's getting late), so if you want to add them all to the array, which I think you would, click here. Again, laziness!
Now that we have everything set up, we can execute our script:
Code:
var f = function(mid, cid) { // function parameters: { mid: textbox id, cid: cell/element id }
var el1 = document.getElementById(mid);
var el2 = document.getElementById(cid);
var colorArr = [
["aqua", "#00FFFF"],
["black", "#000000"],
["blue", "#0000FF"],
["fuchsia", "#FF00FF"],
["gray", "#808080"],
["green", "#008000"],
["lime", "#00FF00"],
["maroon", "#800000"],
["navy", "#000080"],
["olive", "#808000"],
["purple", "#800080"],
["red", "#FF0000"],
["silver", "#C0C0C0"],
["teal", "#008080"],
["white", "#FFFFFF"],
["yellow", "#FFFF00"]
];
for(i = 0; i < colorArr.length; i++) {
if(el2.style.backgroundColor.toLowerCase() == colorArr[i][0]) { // checks for color name
el1.value = colorArr[i][1]; // sets value in textbox
return; // exits function
}
}
el1.value = el2.style.backgroundColor;
};
var i = 5;
var x = setInterval(f("textbox_id", "cell_id"), i);
Ththththththat's all, folks! If you have anymore questions, which I believe you shall have, ask them with no fear or remorse 
And: do you mind telling us what this is actually going to be used for? Thanks!
Bookmarks