brewer.awk 445 B

12345678910111213141516171819
  1. #
  2. # Convert Brewer data to same RGB format used in color_names.
  3. # See brewer_colors for input format.
  4. #
  5. BEGIN {
  6. FS = ",";
  7. }
  8. /^[^#]/{
  9. if ($1 != "") {
  10. # Close previous file handle to avoid exhausting file descriptors on macOS
  11. # https://gitlab.com/graphviz/graphviz/-/issues/1965
  12. if (name) {
  13. close(name);
  14. }
  15. name = "colortmp/" $1 $2;
  16. gsub ("\"","",name);
  17. }
  18. printf ("%s %s %s %s\n", $5, $7, $8, $9) > name;
  19. }