Is it possible to calculate a color in a middle of a gradient? I only have two hex strings, and I want one in return. Answer This should work: It basically involves converting them to decimal, finding the halves, converting the results back to hex and then concatenating them.