GrandPerspective uses the Uniform Type Identifier system that is part of macOS for classifying files into file types. A file is mapped to a file type by way of its extension. For example, files with an .jpg or .jpeg extension map to the public.jpeg type, which represents JPEG images. A file type can conform to other (more general) file types. For example, files of type public.jpeg conform to the more general public.image type.
You can color files according to their file type by selecting the "File type" color mapping from the Display tab in the Control panel. You can change the way the file types are mapped to different colors by editing the "File type" color mapping.