The two traits in the question--hemophilia and colorblindness are both called sex-linked recessive traits. They are linked to the X chromosome. Females are XX because they have two X chromosomes, while males are XY and only have one X chromosome.
Because of this, females will have two genes for traits located on the X chromosome, but males will only have one gene because they only have one X chromosome.
Males are said to be hemizygous for traits on the X chromosome. All males receive their X chromosome from their mother and a Y chromosome from their father. The allele for colorblindness or hemophilia can only be found on the X chromosome. Therefore, if a male inherits a gene like colorblindness or hemophilia, it was passed from mother to son.
We can represent the allele for colorblindness or hemophilia as an X- and the allele for the normal trait as a plain X.
Female genotypes can be XX, X- X, or X- X-
If she is XX, neither of her genes contains the mutant phenotype and she is homozygous normal. If she is X-X, she has one normal and one mutant gene and she is a heterozygous female carrier. This is because the normal X gene is dominant to mutant X- gene. But, if she has the genotype X-X-, she has two mutant alleles and would have the disease.
For males, there are only two possible genotypes: XY or X-Y
The XY male will be normal but the X-Y male has the mutant gene on his X chromosome and will express this as the disease hemophilia or colorblindness.
Therefore, for the traits of hemophilia or colorblindness, females will have two genes. Males will only have one gene.