A fits file with a Bayer structure stores the luminance transmitted through the 2-dimensional Bayer filter in cmos as it is in a 2-dimensional structure.
This is how fits are generated in an astrophotography application.
Next, the file is converted to RGB using the debayer operation in an image processing application.