I have a web application that includes a file browser. I have a little database that associates a FontAwesome icon to a variety of content-types (i.e. images, word/lowriter files, excel/localc files, PDF, plain text, archives, etc.). I copy/paste here for completeness (it's TypeScript for use with React-FontAwesome):
const iconClasses: { [key: string]: IconDefinition } = {
// Media
"image": faFileImage,
"audio": faFileAudio,
"video": faFileVideo,
// Documents
"application/pdf": faFilePdf,
"application/msword": faFileWord,
"application/vnd.ms-word": faFileWord,
"application/vnd.oasis.opendocument.text": faFileWord,
"application/vnd.openxmlformats-officedocument.wordprocessingml":
faFileWord,
"application/vnd.ms-excel": faFileExcel,
"application/vnd.openxmlformats-officedocument.spreadsheetml":
faFileExcel,
"application/vnd.oasis.opendocument.spreadsheet": faFileExcel,
"application/vnd.ms-powerpoint": faFilePowerpoint,
"application/vnd.openxmlformats-officedocument.presentationml":
faFilePowerpoint,
"application/vnd.oasis.opendocument.presentation": faFilePowerpoint,
"text/plain": faFileAlt,
"text/html": faFileCode,
"application/json": faFileCode,
// Archives
"application/gzip": faFileArchive,
"application/zip": faFileArchive
};
export function getFontAwesomeIconFromMIME(mimeType: string): IconDefinition {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
const candidate = Object.entries(iconClasses).find(([k]) =>
mimeType.startsWith(k)
)
if (candidate === undefined) {
return faFile;
} else {
return candidate[1];
}
}
However these icons are gray. I would like to associate an "iconic" color to icons (in RGB format). I'm not a UI guy, but it seems that these colors are somewhat standardized. For example, PDF icons are red, Word icons blue, Excel icons are green, archives are yellow, and so on.
Does one have such a list of iconic colors?