in reply to Re: Best way to validate a string as a color?
in thread Best way to validate a string as a color?

G'day Alexander,

Just some supporting information regarding your "Mac" comments.

"MacOS X inherits from Unix, but does many things differently."

It does have the "rgb.txt" file but it's in a different directory: "/opt/X11/share/X11/". There's a symlink from "/usr/X11/" to "/opt/X11/", so these are the same file:

$ ls -i1 /opt/X11/share/X11/rgb.txt /usr/X11/share/X11/rgb.txt 85658151 /opt/X11/share/X11/rgb.txt 85658151 /usr/X11/share/X11/rgb.txt

I ran the code you showed below and got the same numbers:

$ perl -nE '@x=split;$seen{join(" ",@x[0,1,2])}++;END{say 0+keys%seen} +' < /opt/X11/share/X11/rgb.txt 512 $ wc -l /opt/X11/share/X11/rgb.txt 782 /opt/X11/share/X11/rgb.txt

I downloaded a copy of the Xorg version you linked below. After canonicalising the whitespace of that and my local copy with:

$ perl -ne 's/[\t ]+/ /g; print' original_name > canonical_name

A diff showed them to be identical.

"AFAIK, you can run X11 on MacOS X, but it does not run X11 out of the box."

That's correct on both counts.

My version is 10.12.5 "macOS Sierra".

[Yes, they've changed the name from "Mac OS X" to "macOS". I have no idea why. As far as I was aware, the "X" was intended to be a roman numeral referring to the "10.x.x" series: the major version is still "10". ]

— Ken