How do I detect a Minecraft banner of a specific color?

I have read the entire internet and discovered the ways to detect banners with specific base colors. It turns out that I was really close. Here are some examples that are working in 1.8.1:

Test for a placed banner (on the ground) that is Blue colored ({Base:4}), and facing north (8):

/testforblock 60 14 116 minecraft:standing_banner 8 {Base:4}

Test for a placed banner (hanging) that is Blue colored ({Base:4}), and facing north (2):

/testforblock 48 2 38 minecraft:wall_banner 2 {Base:4}

Test for a banner in a player's inventory (note the 4s means Blue. The s is important):

/testfor @p {Inventory:[{Slot:103b,id:"minecraft:banner",Damage:4s}]}

Test for a banner that has been dropped on the ground that is Blue colored (Damage:4s):

/testfor @e[type=Item,x=40,y=1,z=40,dx=40,dy=27,dz=80] {Item:{id:"minecraft:banner",Damage:4s}}

Notes:

  • The values for facing didn't appear to be optional in my tests. Without them, the match would simply fail. See all the values for facing here. Please correct me if I'm wrong.
  • It's possible to match every detail about the flag, including the patterns, as demonstrated here.
  • The banner base color "Damage" or "Base" values are 0-15. 0 being black, 1 being red, etc. etc.