# colortype

*The*The

`colortype`

filter is deprecated. Use `piecename`

instead.`colortype`

filter takes one argument, a set filter. If its argument represents a set with exactly one square, then the value of the `colortype`

filter is
a number that represents the color and type of the piece
on that square:

x=colortype a1 y=colortype h1 x==y

If the argument set filter does not represent a set that has exactly one element, the `colortype`

filter does not match the position.

Otherwise, suppose *s* is the square represented by the argument set filter. Then:

- If
*s*is not occupied by a piece,`colortype`

is 0.*s* - If
*s*is occupied by a white piece, thencolortype

*s*== type*s* - If
*s*is occupied by a black piece, thencolortype

*s*== - type*s*