Thank you very much you both lead me in the right direction !
I found just what I was looking for.
You can get my function for collecting color schemes colors at the bottom of this post.
The solution was :
ColorSchemes files or .icls
files look like this :
<scheme name="ThemeName" version="142" parent_scheme="Darcula">
<metaInfo>
</metaInfo>
<colors>
<option name="ADDED_LINES_COLOR" value="98c379" />
</colors>
<attributes>
<option name="ABSTRACT_CLASS_NAME_ATTRIBUTES">
<value>
<option name="FOREGROUND" value="e6c07b" />
</value>
</option>
</attributes>
</scheme>
You can get those colors programmatically , in java (sorry I don't know how to do it in Kotlin) you can fetch the current color scheme by doing :
EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getSchemeForCurrentUITheme();
Or you can get the default color scheme by doing :
EditorColorsScheme colorsScheme = = EditorColorsManager.getInstance().getScheme(EditorColorsManager.getInstance().getAllSchemes()[0].getName());
From that I've made a simple function that can fetch a specific color by its name (attribute and colors). If the name given does not correspond to a color defined in <attributes> it will look in the <colors> section. You can also precise if you specifically want the background color of an attribute.
Here is the function :
public Color fetchIJColor(String name, boolean isBackground){
Color c = colorsScheme.getAttributes(TextAttributesKey.createTextAttributesKey(name)).getForegroundColor();
if(c == null || isBackground){
c = colorsScheme.getAttributes(TextAttributesKey.createTextAttributesKey(name)).getBackgroundColor();
}
if(c == null){
c = colorsScheme.getColor(ColorKey.createColorKey(name));
}
return c;
}