Consider the following function:
let private actionPixel(pixelColour:Color) =
match (pixelColour.A, pixelColour.R, pixelColour.G, pixelColour.B) with
| (0uy, _, _, _) -> transparent
| (alpha, red, green, blue) when red = blue && red = green && red <> 255uy ->
Color.FromArgb(calculateAlpha (int alpha) (int red), 0, 0, 0)
| _ -> pixelColour
What I'd like to do is replace | (alpha, red, green, blue) when red = blue && red = green && red <> 255uy ->
with | (alpha, value, value, value) when value <> 255uy ->
. If I do that though, I get a 'value' is bound twice in this pattern
error.
Is there a way to rewrite the line to simplify the guard that satisfies the compiler?