# Feasibility of Magneto-Encephulography Scan under Color-Tailored Illumination
## Appendix A Method and Notations of Color Conversion  
Presently, red, green, and blue (RGB) are considered the primary colors based on biological makeup of the human eye, which contains three types of color receptors, the cone cells. Color matching or mixing is adding colors together to match the target color. The three primary RGB colors (known as tri-stimulus values) are used to define other colors, e.g., if R and G are mixed in equal proportions, it will produce yellow color. However, it is not possible to match all the colors in the spectrum by adding RGB primary colors; some colors require negative red light to match with the target color (reflected by the first Grassmann law). Additionally, there are different possibilities to mix colors for the same target color. e.g., the color generated by adding R to cyan is similar to the color created by adding G and B colors [22; 23]. [PERSON] was the first to quantify color measurements and proposed RGB as primary colors forming an orthogonal coordinate system, which define a color triangle [11]. The color triangle is obtained by cutting the RGB color space. Any color in the triangle can be determined by the color coefficients \(r,g,b\) of the RGB components. In this description, the brightness is ignored, and coefficients \(r+g+b=1\)[24]. To overcome negative RGB values required to define some colors and to describe brightness of the colors, the International Commission on Illumination (CIE), in 1931, introduced \(X,Y\), and \(Z\) imaginary primary colors. Here, \(Y\) represents the luminance or brightness, \(Z\) represents the blue stimulation (the S cone response in eye), and \(X\) represents the linear combination of cone response curves chosen to be non-negative. According to this CIE XYZ model, the XZ plane has all the possible chromaticities, while \(Y\) presents its brightness [22; 23]. The spectral power distribution (SPD) provides the visual profile of a light source and gives the radiant power emitted by the sources at each wavelength \(\lambda\) or the range of wavelengths. The SPD describes the power per unit area \(A\) per unit wavelength \(\lambda\) of an illumination \(M(\lambda)=\frac{\partial^{2}\phi}{\partial A\partial\lambda}\), where \(\phi\) is the radiant flux [23]. The CIE color matching functions are defined for the visible spectral window 380-780 nm in such a way that \(X=\int_{380}^{780}M(\lambda)\times\bar{x}(\lambda)d\lambda\), \(Y=\int_{380}^{780}M(\lambda)\times\bar{y}(\lambda)d\lambda\), \(Z=\int_{380}^{780}M(\lambda)\times\bar{z}(\lambda)d\lambda\), where \(\bar{x}(\lambda),\bar{y}(\lambda),\bar{z}(\lambda)\) are the CIE defined color matching functions. The CIE chromaticity diagram (inset in Figure 1) is based on Maxwell's color triangle, which is projected onto two dimensional xy-plane. As a result, all the colors can be represented with two coordinates \(xy\) as \(x=\frac{X}{X+Y+Z},y=\frac{Y}{X+Y+Z},z=\frac{Z}{X+Y+Z}\equiv 1-x-y\). To identify color in practice, the CIE's \(xy\gamma\) presentation is widely adopted, where \(x\) and \(y\) are the coordinates of the chromaticity diagram of a given color and \(Y\) is its luminance. Therefore, \(X,Z\) tri-stimulus values can be calculated by \(X=\frac{x}{y}Y\), \(Z=\frac{Y}{y}(1-x-y)\) and \(Y=Y\). Chromaticity xy-coordinates do not depend on the luminance (see a practical example in the Supplement Figure A1). [PERSON] proposed that color matching can be treated as algebraic equations, i.e., any given wavelength is naturally denoted by the linear combination of the given set of primary colors \((P_{1},P_{2},P_{3})\). This given set of color can be represented as a linear sum of another primary set of colors \((Q_{1},Q_{2},Q_{3})\) using matrix notation [11; 22; 23]. Based this linear transformation theory, CIE specified the standard that can convert RGB color space to XYZ color space and vice versa:\[ \begin{bmatrix}X\\ Y\\ Z\end{bmatrix} =\frac{1}{b_{21}}\times \begin{bmatrix}b_{11}&b_{12}&b_{13}\\ b_{21}&b_{22}&b_{23}\\ b_{31}&b_{32}&b_{33}\end{bmatrix} \times