Intention of named colors?

Dear all,

while writing a style guide / design system for our Ionic-based applications, I was wondering about the intention behind the various named colors in Ionic. Okay, names like “success”, “warning” and “danger” are easily understandable, similar for “dark”, “medium”, “light”.

But what about “primary”, “secondary” and “tertiary” (which - if I remember correctly - was introduced only recently with v4). Especially when looking at the default theme. From a UX perspective, I would imagine that “primary” should be used for the most important action on a page (“CTA”), however, this is the default when no other color is defined at a button. besides, “secondary” and “tertiary” are no less prominent.

Is there any documentation about the intentions behind this structure?