TITLE: Categorical definition of Spectrum of a ring as a colimit?
QUESTION [14 upvotes]: I've been watching AGITTOC: Algebraic geometry in the time of Covid; Pseudolecture 3, where a user describes an alternative definition of the spectrum of a ring:

(Name hidden for privacy): I like the definition of $\operatorname{Spec}(A)$ that doesn't include the word
prime ideal, by a colimit of $\operatorname{Hom}(A, k)$ where $k$ run over all fields and the
maps are morphisms that make the diagrams commute.

I've been trying to find a reference to this, to no avail.  The closest thing  could find is this reference in the Stacks project which talks about how if the ring $A$ is built up as a colimit of $A_i$, then the spectrum $\operatorname{Spec}(A)$ is built up as the limit of $\operatorname{Spec}(A_i)$.  This does not seem to be what I am looking for.
Can someone please provide a reference and/or quickly exposit this definition of $\operatorname{Spec}(A)$ which I have not seen before?

REPLY [7 votes]: The main idea there is that if $f:A\to k$ is a morphism of rings, then $\ker f$ is a prime ideal of $A$.
I would like to point out that this is precisely how Peter Scholze defines the spectrum of a ring in his Bonn course. There are some typed notes here: https://www.math.uni-bonn.de/people/ja/alggeoI/notes.pdf.