Hexatrigesimal file icon colors

From NikkiWiki
(Redirected from Computer file icon colors)
Jump to navigation Jump to search

Computer file icon sets are typically for only a limited number of filetypes which often exclude rare or unusual filetypes.  By assigning a 3-digit hexatrigesimal (base-36) number to each filetype, 363 = 46656 unique file icons can be generated.

assigning triplets

Begin by assigning every file extension a three-character name.  For most file extensions with more than three characters, the extension can simply be truncated to the first three characters.  Otherwise, new three-character names will need to be assigned to conflating file extensions.  For example: ".xls", ".xlsx", and ".xlsm" can be assigned as XLS, XLX, and XLM.  One-letter and two-letter file extensions can be represented as three-letter file extensions by adding trailing zeros.  For example: ".m" and ".7z" files assigned as M00 and 7Z0.

character mapping

Each character from 0 to Z can now be used to represent a hexatrigesimal number digit.  Each hexatrigesimal digit from 0 to Z has to then be assigned an integer decimal (base-10) value from 0 to 255.  This series of decimal integers from 0 to 255 are then converted to their corresponding values of 0 to FF in hexadecimal (base 16).

base-36 number base-10 number base-10 value base-16 value
0 0 0 0
1 1 7 7
2 2 15 F
3 3 22 16
4 4 29 1D
5 5 36 24
6 6 44 2C
7 7 51 33
8 8 58 3A
9 9 66 42
A 10 73 49
B 11 80 50
C 12 87 57
D 13 95 5F
E 14 102 66
F 15 109 6D
G 16 117 75
H 17 124 7C
I 18 131 83
J 19 138 8A
K 20 146 92
L 21 153 99
M 22 160 A0
N 23 168 A8
O 24 175 AF
P 25 182 B6
Q 26 189 BD
R 27 197 C5
S 28 204 CC
T 29 211 D3
U 30 219 DB
V 31 226 E2
W 32 233 E9
X 33 240 F0
Y 34 248 F8
Z 35 255 FF

file extensions

Each file-extension character triplet corresponding to a 3-digit base-36 number between 000 and ZZZ now represents one of 363 = 46656 possible colors from #000000 to #ffffff.

extension triplet hexcolor color
DefaultIcon 000 #000000
7z 7Z0 #33ff00
css CSS #57cccc
doc DOC #5faf57
docx DOX #5faff0
htm HTM #7cd3a0
ico ICO #8357af
jpg JPG #8ab675
mediawiki MED #a0665f
mht MHT #a07cd3
ods ODS #af5fcc
odt ODT #af5fd3
oxps OXP #aff0b6
pdf PDF #b65f6d
png PNG #b6a875
svg SVG #cce275
txt TXT #d3f0d3
xht XHT #f07cd3
xls XLS #f099cc
xlsx XLX #f099f0
xml XML #f0a099
xps XPS #f0b6cc
zip ZIP #ff83b6
^^DIRECTORY^^ ZZZ #ffffff

SVG

A simple monochromatic icon can be created with Scalable Vector Graphics (SVG) Extensible Markup Language (XML).  View icon examples.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16" width="16">
<title>MEDIAWIKI (Wikimedia MediaWiki) icon</title>
<rect height="16" width="16" fill="#a0665f" />
<!--
© (Copyright) 2026-04-13 Nicole Sharp
Nicole Sharp’s Homepage: https://www.nicolesharp.net/
Content in this file is available under the Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 International Public License: https://www.nicolesharp.net/wiki/CC_BY-SA
-->
</svg>

HTACCESS

The new icons can now be implemented in ASF (Apache Software Foundation) Hypertext Protocol (HTTP) Server Access (HTACCESS) Index Options.

IndexOptions +FancyIndexing
DefaultIcon /images/icons/filetypes/000.svg
AddIcon /images/icons/filetypes/zzz.svg ^^DIRECTORY^^
AddIcon /images/icons/filetypes/7z0.svg .7z
AddIcon /images/icons/filetypes/css.svg .css
AddIcon /images/icons/filetypes/doc.svg .doc
AddIcon /images/icons/filetypes/dox.svg .docx
AddIcon /images/icons/filetypes/htm.svg .htm .html
AddIcon /images/icons/filetypes/ico.svg .ico
AddIcon /images/icons/filetypes/jpg.svg .jpg .jpeg
AddIcon /images/icons/filetypes/med.svg .mediawiki
AddIcon /images/icons/filetypes/mht.svg .mht .mhtml
AddIcon /images/icons/filetypes/ods.svg .ods
AddIcon /images/icons/filetypes/odt.svg .odt
AddIcon /images/icons/filetypes/oxp.svg .oxps
AddIcon /images/icons/filetypes/pdf.svg .pdf
AddIcon /images/icons/filetypes/png.svg .png
AddIcon /images/icons/filetypes/svg.svg .svg
AddIcon /images/icons/filetypes/txt.svg .txt
AddIcon /images/icons/filetypes/xht.svg .xht .xhtml
AddIcon /images/icons/filetypes/xls.svg .xls
AddIcon /images/icons/filetypes/xlx.svg .xlsx
AddIcon /images/icons/filetypes/xml.svg .xml
AddIcon /images/icons/filetypes/xps.svg .xps
AddIcon /images/icons/filetypes/zip.svg .zip
IndexOptions +IconsAreLinks
# https://httpd.apache.org/docs/current/mod/mod_autoindex.html

problems

There are still a couple of problems here.  The first is that most file extensions do not contain decimal number characters so about ten thousand or thirty percent (~10/36) of available colors are under-utilized.  An attempt to solve this can be by contracting the hexatrigesimal (base-36) color space from 036 to Z36 to a hexavigesimal (base-26) color space from A26 to Z26.  This results in 263 = 17576 possible colors.  But even eliminating 29080 extraneous colors does not help to significantly resolve the second problem in that consecutive colors such as for ".ods" versus ".odt" are extremely difficult to practically impossible to distinguish visually.  Even if the human viewer cannot tell the difference though, the assigned colors are still mathematically unique which provides a second semantic signal to indexing bots in addition to the file extension.  For practical usage by humans, consecutive file extensions are often for the same application.  For example: both ".ods" and ".odt" are for LibreOffice so this still provides a useful semantic cue for the human viewer (as intended) even if these two individual colors cannot be differentiated visually.  There may exist other extension pairs though that could be visually conflated but this problem exists with a traditional icon set as well in that with limited icons available, multiple file extensions have to be assigned the same icon.