The invention relates to the technical field of medical detection, in particular to an 
algorithm for calculating the test strip color by using 
LAB color space components, which makes the test effect more accurate, and comprises the following steps: step 1, converting RGB color components into the LAB color components by establishing a channel XYZ 
color space; step 2, defining X, Y, Z and t variables to be in the range [0, 1]; step 3, defining the range of the L component as [0, 100], and defining the range of the A and B components are both [-127, 127]; and step 4, optimizing the 
floating point number of results of each LAB component: optimization of a function f(t); converting the 
RGB color space to the 
LAB color space; and performing corresponding conversions on the L, A and B values ofthe 
LAB color space through the corresponding 
algorithm; the corresponding conversions and trade-off are performed on the 
floating point values of the obtained L, A and B values again, and then tablelookup 
method comparison is performed, therefore, the obtaining error of the test strip color is greatly reduced.