Q:

Coloring random points in an annulus

I have found the following random generator to generate points in an annulus in stackoverflow on stackoverflow
f[] := Block[{u, t, r}, u = Random[] + Random[];
r1 = 1; r2 = 0.3;
t = Random[] 2 Pi;
r = If[u > 1, 2 - u, u];
r = If[r < r2, r2 + r*((R1 - R2)/R2), r];
{r Cos[t], r Sin[t]}]

ListPlot[Table[f[], {10000}], AspectRatio -> Automatic]

Now I would like to for instance color red when xy positive or blue when xy is negative. I have tried tweaking around with ColorFun but that gives me very beautiful images, but nothing what I actually want.
What is the best method to approach this problem?

A:

You already receive great answers concerning the colors, but your random generator confuses me. It is not uniform in the annulus and it's not efficient. I propose the following short and fast generator
randomInAnnulus[R1_, R2_, n_] := 
  Transpose@{# Cos@#2, # Sin@#2} &[Sqrt@RandomReal[{R1, R2}^2, n], RandomReal[2 π, n]];

pts = randomInAnnulus[1, 2, 20000000];

Histogram3D[pts, 50]

A:

R1 = 2;
R2 = 3;
t = Table[f[], {10000}];
vc = If[Times @@ # <= 0, Blue, Red] & /@ t;

Use Graphics with VertexColors:
Graphics[Point[t, VertexColors -> vc], Axes -> True, AspectRatio -> Automatic]

Split the data based on Sign [x y] and use PlotStyle:
t2 = Pick[t, Sign[Times @@@ t], #] & /@ {1, -1};
ListPlot[t2, AspectRatio -> Automatic, PlotStyle -> {Red, Blue}]

or
t3 = GatherBy[t, Sign[Times @@ #] &];
ListPlot[t3, AspectRatio -> Automatic, PlotStyle -> {Red, Blue}]

Post-process ListPlot output to re-color the points:
ListPlot[t, AspectRatio -> Automatic]  /. 
     Point[x : {__}] :> ({If[ Times @@ # <= 0, Red, Blue], Point@#} & /@ x)

or
ListPlot[t, AspectRatio -> Automatic]  /.  Point[x_] :> Point[x, VertexColors -> vc]

to get

Update: Following ybeltukov's lead ...
Using TransformedDistribution and RandomVariate to generate random points in an annulus
ClearAll[annulusDist];
annulusDist[r1_, r2_, t1_: 0, t2_: 2 Pi] := 
  TransformedDistribution[Sqrt@v {Cos[u], Sin[u]},
   {u \[Distributed] UniformDistribution[{t1, t2}], 
    v \[Distributed] UniformDistribution[{r1^2, r2^2}]}];

pts1 = RandomVariate[annulusDist[1, 2], 2000000];
Histogram3D[pts1, 50, ImageSize -> 500]

pts2 = RandomVariate[annulusDist[1, 2, Pi/4, 7 Pi/4], 5000];

ListPlot[Pick[pts2, Sign[Times @@@ pts2], #] & /@ {1, -1}, 
 AspectRatio -> 1,  PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, PlotStyle -> {Red, Blue}]

