There were two codes, the Naval code and the Diplomatic code, AKA the Purple Code. The purple code was brown to a degree, the naval code not.
I have read a a few books on this and while there was a heightened level, and there were some terrible mistakes, one being Admiral Richmond Turner and his responsibility in this fiasco.
https://en.wikipedia.org/wiki/Richmond_K._Turner
The whereabouts of the Japanese Fleet was unknown and at one point the thinking was they would attack the Aleutians, not Pearl Harbor.
All in all a very confusing period.
“The whereabouts of the Japanese Fleet was unknown and at one point the thinking was they would attack the Aleutians, not Pearl Harbor.”
Sorry I find that hard to believe. They had multiple listening stations from Manila to San Francisco and they couldnt pinpoint them? Seriously..
https://www.youtube.com/watch?v=2Rv2J-YDThA
[Ever heard of J-19?]