Closed nyancol closed 5 years ago
Even when clustered, how do you choose the final color of a cluster? If you have 16 colors required for terminal, that's 16 clusters, then how do you suggest we decide which color is the one?
Indeed, that is why I used a k-medoid classification, so that each cluster is defined by a center, that is also a real color taken from the color's list.
One cluster of colors is selected for each major syntactic group (e.g., Statement
is a major syntactic group, that contains: Conditional
, Repeat
etc.), and then colors from the cluster are mapped to the subgroups of the group. My idea was that if
and for
should have similar hues. But know that I think of it, that might not be true for Constant
, which includes String
, Character
, Number
, etc.
Any thoughts?
Here's the list:
Yes I was mostly thinking about the Constant group, and the difference between string and numbers and booleans
Do splitting the Constant
group into: [[String, Character], [Constant, Number, Float], [Boolean]]
would be enough to overcome this issue?
This pull request introduces new clever algorithm to cast the colors of the generated palette to vim's syntactic groups, it features:
I advice you to review the three previous pull request before starting this one.
The clustering algorithm could be useful for other purposes, such as terminal color casting (or lightline, yabar ...). For instance, the colors could be first classified into K clusters, K standing for the number of colors that can be affected to a terminal profile, and then use the medoids of each cluster as the color.