Add categoryColour as special parameter to use for the icon colour (#8)

Add categoryColour as special parameter to use for the icon colour (#8)

diff --git a/.gitignore b/.gitignore
index d84e968..e630d2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,71 @@
-.discourse-site
\ No newline at end of file
+.discourse-site
+# Created by https://www.toptal.com/developers/gitignore/api/eclipse
+# Edit at https://www.toptal.com/developers/gitignore?templates=eclipse
+
+### Eclipse ###
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# CDT- autotools
+.autotools
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+# Annotation Processing
+.apt_generated/
+.apt_generated_test/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+# Uncomment this line if you wish to ignore the project description file.
+# Typically, this file would be tracked if it contains build/dependency configurations:
+.project
+
+### Eclipse Patch ###
+# Spring Boot Tooling
+.sts4-cache/
+
+# End of https://www.toptal.com/developers/gitignore/api/eclipse
diff --git a/javascripts/discourse/initializers/category-icons.js b/javascripts/discourse/initializers/category-icons.js
index 17e034b..0e2f765 100644
--- a/javascripts/discourse/initializers/category-icons.js
+++ b/javascripts/discourse/initializers/category-icons.js
@@ -107,9 +107,9 @@ export default {
         /// Add custom category icon from theme settings
         let iconItem = getIconItem(category.slug);
         if (iconItem) {
-          let itemColor = iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
-          let itemIcon = iconItem[1] != "" ? iconHTML(iconItem[1]) : "";
-          html += `<span ${itemColor} class="category-badge-icon">${itemIcon}</span>`;
+        let itemColor = iconItem[2] == 'categoryColour' ? `style="color: #${color}"` : iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
+			let itemIcon = iconItem[1] != "" ? iconHTML(iconItem[1]) : "";
+			html += `<span ${itemColor} class="category-badge-icon">${itemIcon}</span>`;
         }
         /// End custom category icon
 
diff --git a/settings.yml b/settings.yml
index 0c0fecf..d5b7119 100644
--- a/settings.yml
+++ b/settings.yml
@@ -1,7 +1,7 @@
 category_icon_list: 
   default: 'help,question-circle,#CC0000,partial|'
   type: 'list'
-  description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,colour,match". If  match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
+  description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,colour,match". Colour in format #123456 or "categoryColour" to use the default colour for the category (same as the Badge colour). If  match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
 svg_icons: 
   default: 'question-circle'
   type: 'list'
@@ -9,4 +9,4 @@ svg_icons:
   description: 'List of FontAwesome 5 icons used in this theme component'
 category_lock_icon: 
   default: ''
-  description: 'Enter the name of a FontAwesome 5 icon to display instead of the lock icon next to private categories.'
\ No newline at end of file
+  description: 'Enter the name of a FontAwesome 5 icon to display instead of the lock icon next to private categories.'

GitHub sha: e88463d9

This commit appears in #8 which was merged by pmusaraj.