#autoload

#

local expl

if (( ! $+_color_cache )); then
  local file


  zstyle -s ":completion:${curcontext}:colors" path file
  if [[ -n "$file" ]]; then
    _color_cache=( "${(@)${(@f)$(< $file)}[2,-1]##*		}" )
  else
    file=( /usr/{lib,{{X11R6,openwin},local{,/X11{,R6}}}/lib}/X11/rgb.txt(N) )

    (( $#file )) &&
        _color_cache=( "${(@)${(@)${(@f)$(< $file[1])}[2,-1]##*		}:#* *}" )
  fi


  (( $#_color_cache )) || _color_cache=(white black gray red blue green)
fi

_wanted colors expl 'color specification' compadd "$@" -M \
    'm:{a-z}={A-Z} m:-=\  r:[^ A-Z0-9]||[ A-Z0-9]=* r:|=*' -a - _color_cache
