+static ARGB blend_colors_pre(ARGB start, ARGB end, REAL position) +{ + const BYTE a = ((start >> 24) & 0xff) * (1 - position) + ((end >> 24) & 0xff) * position; + const BYTE r = ((start >> 16) & 0xff) * (1 - position) + ((end >> 16) & 0xff) * position; + const BYTE g = ((start >> 8) & 0xff) * (1 - position) + ((end >> 8) & 0xff) * position; + const BYTE b = (start & 0xff) * (1 - position) + (end & 0xff) * position; + + return (a << 24) | (r << 16) | (g << 8) | b; +}
I'm confused by the introduction of this function. It seems to be for blending PARGB colors, but the hatch brush colors are ARGB.