Given a LinearGradientBrush
defined as follows:
<LinearGradientBrush x:Key="RedYellowGradient">
<GradientStop Color="Blue" Offset="0.01" />
<GradientStop Color="Purple" Offset="0.25"/>
<GradientStop Color="Red" Offset="0.5"/>
<GradientStop Color="Orange" Offset="0.75"/>
<GradientStop Color="Yellow" Offset="1.0"/>
</LinearGradientBrush>
What is required to take that definition and determine the color represented by a specific offset, such as 0.13 or 0.82 without rendering anything visible?
This would take the form of a function with a prototype something like this:
Function GetColorFromBrushOffset(br as LinearGradientBrush, offset as Single) as SomeColorDataStructure
What would need to go in the function body? I'm not looking for finished code (though I won't refuse it!) just some ideas about what data structures and system calls to use.