I created a custom color scheme, now I want to make it a plug-in. Harder than expected

I have a working color scheme up in my GitHub, and I have been updating it for the past week. I would like to start advertising my color scheme, but I first want to have a method in which people can easily update the color scheme as I update and improve it. The only issue, is everything is pull-based.

I will update my color scheme to GitHub, and if I am lucky, then people will redownload and reinstall the new color scheme. This is inefficient, and will cause most people to have my old version.

I recently noticed I can create my own Plugin. I assumed that it would be a rather quick migration from working JAR file with the Editor Colors to working Plugin that can easily have push-notified updates; however, that seems to be far from the case.

I had only Android Studio, but I did recently download IntelliJ IDEA. I ran my plugin, and it opens a new instance of IntelliJ IDEA. It shows that I have my plugin installed; however, when I go to the "Color & Fonts" section within Settings, my color scheme is not available.


Structure:

- ChroMATERIAL
     - META-INF
          - plugin.xml
     - src
          - colors
               - ChroMATERIAL.icls

Plugin.xml

 
<idea-plugin version="2">
    <id>...</id>
    <name>
ChroMATERIAL</name>
    <version>
1.0</version>
    <vendor... > ... </vendor>

    <description>
<![CDATA[
      ...
    ]]>
    </description>

    <change-notes>
<![CDATA[
      Initial Release
    ]]>
    </change-notes>

    <idea-version since-build="131"/>

    <depends>
com.intellij.modules.lang</depends>

    <extensions defaultExtensionNs="com.intellij">
        <additionalTextAttributes scheme="ChroMATERIAL" file="colors/ChroMATERIAL.icls"/>
    </extensions>

    <application-components> </application-components>

    <project-components> </project-components>

    <actions> </actions>

</idea-plugin>
3 comments
Comment actions Permalink

So, I am wondering what actually needs to be done to have just a simple color scheme plugin? I do see in the future creating my own color schemes for specialized XML files that have a specific base tag, so those will need extra programming, and have seen some tutorials on how to achieve that, but what about the current color scheme I have now? Just a simple, single color scheme?

0
Comment actions Permalink
 
I did not try this but it could work:
  
<extensions defaultExtensionNs="com.intellij">
 
          <bundledColorScheme path="colors/ChroMATERIAL.icls" >
 
    </extensions>
0
Comment actions Permalink

sweet, this was very helpful. I will be trying to upload this to the plugin repo soon.

I had to make some minor changes...

Take note that there is no file extension at the end of the path attribute. IntelliJ will automatically attach ".xml" to what every you put below. So "colors/ChroMATERIAL.icls" will become "colors/ChroMATERIAL.icls.xml"

 
<extensions defaultExtensionNs="com.intellij">
    <bundledColorScheme path="colors/ChroMATERIAL" />
</extensions>


Second, I had to rename the icls file to be xml instead.

src
  colors
    ChroMATERIAL.xml
0

Please sign in to leave a comment.