Sorry. I got it myself. face-attributes-as-vector
is not so useful. There is better way to get the colors.
This lists the attributes of a face:
(mapcar 'car face-attribute-name-alist)
:family
:foundry
:width
:height
:weight
:slant
:underline
:overline
:strike-through
:box
:inverse-video
:foreground
:background
:stipple
:inherit
And internal-get-lisp-face-attribute
extracts the information from a face.
(internal-get-lisp-face-attribute 'font-lock-comment-face :foreground) => "Firebrick"
This returns all foreground colors:
(seq-filter (function
(lambda (x)
(stringp (cadr x))))
(mapcar (function
(lambda (face)
(cons face
(let ((fg (internal-get-lisp-face-attribute face :foreground)))
(list fg (color-values fg))))))
(face-list)))
On my system:
((speedbar-separator-face "white" (65535 65535 65535))
(speedbar-selected-face "red" (65535 0 0))
(speedbar-tag-face "brown" (42405 10794 10794))
(speedbar-directory-face "blue4" (0 0 35723))
(speedbar-file-face "cyan4" (0 35723 35723))
(speedbar-button-face "green4" (0 35723 0))
(diff-context "#333333" (13056 13056 13056))
(sh-quoted-exec "magenta" (65535 0 65535))
(sh-heredoc "tan1" (65535 42405 20303))
(yaml-tab-face "red" (65535 0 0))
(tooltip "black" (0 0 0))
(isearch "lightskyblue1" (45232 58082 65535))
(font-lock-constant-face "dark cyan" (0 35723 35723))
(font-lock-type-face "ForestGreen" (8738 35723 8738))
(font-lock-variable-name-face "sienna" (41120 21074 11565))
(font-lock-function-name-face "Blue1" (0 0 65535))
(font-lock-builtin-face "dark slate blue" (18504 15677 35723))
(font-lock-keyword-face "Purple" (41120 8224 61680))
(font-lock-string-face "VioletRed4" (35723 8738 21074))
(font-lock-comment-face "Firebrick" (45746 8738 8738))
(show-paren-mismatch "white" (65535 65535 65535))
(tty-menu-disabled-face "lightgray" (54227 54227 54227))
(tty-menu-enabled-face "yellow" (65535 65535 0))
(success "ForestGreen" (8738 35723 8738))
(warning "DarkOrange" (65535 35980 0))
(error "Red1" (65535 0 0))
(tool-bar "black" (0 0 0))
(minibuffer-prompt "medium blue" (0 0 52685))
(window-divider-last-pixel "gray40" (26214 26214 26214))
(window-divider-first-pixel "gray80" (52428 52428 52428))
(window-divider "gray60" (39321 39321 39321))
(header-line "grey20" (13107 13107 13107))
(mode-line-inactive "grey20" (13107 13107 13107))
(mode-line "black" (0 0 0))
(escape-glyph "brown" (42405 10794 10794))
(region "gtk_selection_fg_color" (11822 13364 13878))
(link-visited "magenta4" (35723 0 35723))
(link "RoyalBlue3" (14906 24415 52685))
(shadow "grey50" (32639 32639 32639))
(default "black" (0 0 0)))