What you are looking for is Path Gradient Brush . Unfortunately, it is not yet available in WPF (but it is in GDI +). Perhaps in a future version ...
I have an idea on how to get an approximate color wheel.
Its high-level description will be the use of linear gradients (rectangles), which are rotated and translated to create a regular polygon, the thickness of which is much wider than the desired width of the ring. Then you “cut out” the shape of the ring from this and use it as your color wheel.
The color wheel has several primary colors (red, green, blue, yellow, etc.). First you need to determine the degree measure from some arbitrary baseline. For example, red is at 0 radians, blue is at pi radians, etc. You also define the inner and outer radius of the ring. Using a trigger, you go around a rectangle drawing rectangle with a linear gradient from the color you start to the next adjacent color. The width of the rectangle should be greater than the width of the ring (you will see why later), and the rectangle must be rotated so that it touches the circle in its middle.
Upon completion, you will have a “colored polygon” (the term that I just composed). Then you extract the ring shape from this polygon, like a cookie cutter, with dough. It would be more than one way to do this. Simply drawing a filled circle from the center to the inner radius with the background will get rid of the middle part. The outside will be harder. I don’t know if you can do this in WPF, but you will need to create a mask that is a circle from the center to the outer edge of the ring. It would be a white circle on a black background. Then you are an “AND” with an image to get rid of the outside of the polygon.
Not perfect, but it will look reasonable, I suspect. Lots of triggers!
colithium
source share