The idea for the tunnel stemmed from the rainbow images created and displayed by the community over the last year to show support for the NHS and key workers through the pandemic.
The NHS Foundation Trust says the rainbow tunnel, which connects the main Harrogate District Hospital building to the Briary Wing, is also a symbol for celebrating equality and diversity.
A post on its Facebook page reads: "The idea for having a rainbow in the tunnel came about when members of the public were painting and drawing fantastic rainbows to put in their windows at home to show support for the NHS.
"Walking through the arches of the tunnel, we thought it would make a great location to bring those rainbows from the community into the hospital, so that we all - colleagues, patients and visitors -were reminded of the love and support shown by so many people. The rainbow is a lasting landmark within the hospital, a symbol for equality and diversity, and as a space to walk through when you need some colour in your day.
"Most importantly – We hope it brings a smile to faces that walk through it."
Residents have flocked to show their support on the Facebook post.
Margaret Jarvis wrote: "That really is fantastic....so warming and colourful for everyone to walk through it with such a special meaning."
Hazel Ludwighodges added: "Love the rainbow tunnel and thank you all so very much for all you hard work."