I don’t even know how to describe what I want, but here. Suppose I have 3 text fields, and I enter the first hex color code, I want to apply a black layer to it and set the opacity to 50% and get the resulting color in the second text field. The same, but with white on the third.
Let me explain: consider this image below:

In Photoshop, I have a base layer, which is a kind of blue sky. I create two layers on top, one with black, one with white, but both have an opacity of 50%. Now I can use the color picker (I) to just select the two required colors.
I need to do this an insane amount of times, so I was wondering if I could produce it programmatically.
I know, ideally, I had to try something and then give out a code that doesn’t work .. but it greatly alarmed me that I don’t even know where to start. The closest I've seen is Kuler , so I think it's possible in Flash, at least, but again, I don't know where to start.
Can you guys point me in the right direction? Ideally, it would be much better if it were possible in jQuery, but I looked around and could not find anything like it. I am not asking for a working solution , just pushing in the right direction.
If you have any questions, please ask.
The technology is not important to me, the solution is that I like C # the most (at least I like to think that I am), but I'm a beginner in php, flash. Jquery, I am good at this with most things (well, who isn’t?) - Everything that works is good for me. Php and Flash, I learned this as a hobby, just to get to know each other.
Thank you very much.