Repository: galex/name-that-color-intellij-plugin
Branch: master
Commit: 0ae897696890
Files: 29
Total size: 95.0 KB
Directory structure:
gitextract_a4_43eat/
├── .gitignore
├── README.md
├── gradle/
│ └── wrapper/
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── namethatcolor/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── kotlin/
│ │ │ └── il/
│ │ │ └── co/
│ │ │ └── galex/
│ │ │ └── namethatcolor/
│ │ │ ├── core/
│ │ │ │ ├── exception/
│ │ │ │ │ └── ColorNotFoundException.kt
│ │ │ │ ├── manager/
│ │ │ │ │ └── ColorNameFinder.kt
│ │ │ │ ├── model/
│ │ │ │ │ ├── Color.kt
│ │ │ │ │ ├── HexColor.kt
│ │ │ │ │ ├── Hsl.kt
│ │ │ │ │ └── Rgb.kt
│ │ │ │ └── util/
│ │ │ │ ├── ColorExtensions.kt
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── MaterialColors.kt
│ │ │ │ └── Rounding.kt
│ │ │ └── plugin/
│ │ │ ├── annotator/
│ │ │ │ └── ColorAnnotator.kt
│ │ │ ├── completion/
│ │ │ │ ├── CaretCompletionContributor.kt
│ │ │ │ └── ClipboardCompletionContributor.kt
│ │ │ ├── intention/
│ │ │ │ └── NameColorIntention.kt
│ │ │ └── util/
│ │ │ ├── CompletionResultSetExtensions.kt
│ │ │ ├── Constants.kt
│ │ │ └── XmlOutput.kt
│ │ └── resources/
│ │ └── META-INF/
│ │ ├── plugin.xml
│ │ └── withKotlin.xml
│ └── test/
│ └── kotlin/
│ └── il/
│ └── co/
│ └── galex/
│ └── namethatcolor/
│ └── core/
│ ├── manager/
│ │ ├── ColorExtensionsTest.kt
│ │ └── ColorNameFinderTest.kt
│ └── model/
│ └── HexColorTest.kt
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
out
.idea
*.iml
*.jar
.DS_Store
.gradle
build
================================================
FILE: README.md
================================================
# Name That Color - Android Studio Plugin
## Introduction
When I get a new color to set in my Android app, I never know how to call it.
I used the website [Name That Color](http://chir.ag/projects/ntc/) for years, and I wanted to have it integrated inside Android Studio, so I ported its JS library to Kotlin and built this IntelliJ plugin around it.
Besides its long [list of colors](https://github.com/galex/name-that-color-intellij-plugin/blob/master/namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Colors.kt), users requested to add the material colors names, so we can now name our colors as [material colors](https://github.com/galex/name-that-color-intellij-plugin/blob/master/namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/MaterialColors.kt) as well.
This plugin lets you insert a name for a color you copy-paste or type in an android resource file.
# Usage
Two options are available: Clipboard and Quick Fix.
### Clipboard
When you copy your color to add it in your app, you can use **CONTROL+SPACE** instead of pasting it to insert directly the right `<color>` tag.

### Quick Fix
You can insert "aaa" and an error warning in the form of a Quick Fix will show up so you can replace "aaa" with its own `<color name="silver_chalice">#aaa</color> ` tag by using **ALT+ENTER**.

# Color Input
The Plugin accepts all formats of colors allowed in Android (lowercase or uppercase), and you don't need to prefix your color with "#":
* Color
* **abc** -> **#abc**
* **#abc** -> **#abc**
* **aBc** -> **#aBc**
* **ab12dc** -> **#ab12dc**
* **#ab12dc** -> **#ab12dc**
* Alpha + Color
* **6abc** -> **#6abc**
* **#6abc** -> **#6abc**
* **60ab12dc** -> **#60ab12dc**
* **#60ab12dc** -> **#60ab12dc**
# Names
### Name that color
If you chose to use "Name that color", this [list of colors](https://github.com/galex/name-that-color-intellij-plugin/blob/master/namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Colors.kt) is used. If the exact color is not found, the algorithm will find the closest match, if possible.
##### Examples
* Color
* **abc** -> `<color name="casper">#abc</color>`
* **ab12dc** -> `<color name="electric_violet">#ab12dc</color>`
* Alpha + Color
* **6abc** -> `<color name="casper_alpha_40">#6abc</color>`
* **60ab12dc** -> `<color name="electric_violet_alpha_38">#60ab12dc</color>`
* Alpha(%) + Color
* **40%abc** -> `<color name="casper_alpha_40">#66AABBCC</color>`
* **38%ab12dc** -> `<color name="electric_violet_alpha_38">#61AB12DC</color>`
### Name that material color
If you chose to use "Name that material color", this [list of material colors](https://github.com/galex/name-that-color-intellij-plugin/blob/master/namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/MaterialColors.kt) is used. If the exact color is not found, the algorithm will find the closest match, if possible.
##### Examples
* Color
* **abc** -> `<color name="blue_grey_200">#abc</color>`
* **ab12dc** -> `<color name="purple_a700">#ab12dc</color>`
* Alpha + Color
* **6abc** -> `<color name="blue_grey_200_alpha_40">#6abc</color>`
* **60ab12dc** -> `<color name="purple_a700_alpha_38">#60ab12dc</color>`
* Alpha(%) + Color
* **40%abc** -> `<color name="blue_grey_200_alpha_40">#66AABBCC</color>`
* **38%ab12dc** -> `<color name="purple_a700_alpha_38">#61AB12DC</color>`
## Install
In Android Studio, open **Settings** > **Plugins** > **Browse Plugins** and type "**name that color**".
## Thanks
I'd like to thank [aednlaxer](https://github.com/aednlaxer) for submitting bugs and ideas!
## License
This plugin is released under the: Creative Commons License:
Attribution 2.5 http://creativecommons.org/licenses/by/2.5/
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Jan 04 09:52:12 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
================================================
FILE: gradlew
================================================
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: namethatcolor/build.gradle
================================================
buildscript {
repositories {
mavenCentral()
jcenter()
}
}
plugins {
id "org.jetbrains.intellij" version "0.6.5"
id "org.jetbrains.kotlin.jvm" version "1.4.30-RC"
}
repositories {
mavenCentral()
jcenter()
}
intellij {
version '2020.3.2'
pluginName 'NameThatColor'
type 'AI'
}
publishPlugin {
token pluginsDevToken
}
patchPluginXml {
version "1.7.1"
sinceBuild '201.6668.113'
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/exception/ColorNotFoundException.kt
================================================
package il.co.galex.namethatcolor.core.exception
class ColorNotFoundException: Exception()
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/manager/ColorNameFinder.kt
================================================
package il.co.galex.namethatcolor.core.manager
import il.co.galex.namethatcolor.core.exception.ColorNotFoundException
import il.co.galex.namethatcolor.core.model.Color
import il.co.galex.namethatcolor.core.model.HexColor
import il.co.galex.namethatcolor.core.util.colorsMaterialNames
import il.co.galex.namethatcolor.core.util.colorsNames
import il.co.galex.namethatcolor.core.util.hsl
import il.co.galex.namethatcolor.core.util.rgb
import kotlin.math.pow
/**
* Class which loads all the hex codes and names and prepare the RGB and HSL values to be searched for an exact or closest match
* Based on http://chir.ag/projects/ntc/ntc.js
*/
object ColorNameFinder {
private var colors: List<Color> = colorsNames.map { entry -> Color(entry.key, entry.value, entry.key.rgb(), entry.key.hsl()) }
private var materialColors: List<Color> = colorsMaterialNames.map { entry -> Color(entry.key, entry.value, entry.key.rgb(), entry.key.hsl()) }
/**
* look for the Color of an hexadecimal color
*/
fun findColor(color: HexColor) = find(color, colors)
/**
* look for the Color of an hexadecimal material color
*/
fun findMaterialColor(color: HexColor) = find(color, materialColors)
/**
* look for the Color of an hexadecimal color
*/
private fun find(color: HexColor, colors: List<Color>): Pair<HexColor, Color> {
val (r, g, b) = color.rgb()
val (h, s, l) = color.hsl()
var cl = -1
var df = -1
colors.forEachIndexed { index, col ->
if (color.value == col.hexCode) return color to col
else {
val ndf1 = (r - col.rgb.r).toDouble().pow(2.0).toInt() + (g - col.rgb.g).toDouble().pow(2.0).toInt() + (b - col.rgb.b).toDouble().pow(2.0).toInt()
val ndf2 = (h - col.hsl.h).toDouble().pow(2.0).toInt() + (s - col.hsl.s).toDouble().pow(2.0).toInt() + (l - col.hsl.l).toDouble().pow(2.0).toInt()
val ndf = ndf1 + ndf2 * 2
if (df < 0 || df > ndf) {
df = ndf
cl = index
}
}
}
// if not found a close by one, we return an error
if (cl < 0) throw ColorNotFoundException()
// if found, return the name
return color to colors[cl]
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Color.kt
================================================
package il.co.galex.namethatcolor.core.model
data class Color(val hexCode: String, val name: String, val rgb: Rgb, val hsl: Hsl)
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/HexColor.kt
================================================
package il.co.galex.namethatcolor.core.model
import il.co.galex.namethatcolor.core.util.hsl
import il.co.galex.namethatcolor.core.util.rgb
import il.co.galex.namethatcolor.core.util.roundTo2Decimal
import il.co.galex.namethatcolor.core.util.roundTo2HexString
class HexColor(val input: String) {
private var alpha: String? = null
private var hasPercent = false
var percentAlpha: Int? = null
val value: String
init {
var cup = input.toUpperCase()
if (cup.isEmpty()) {
throw IllegalArgumentException("The input cannot be an empty string")
}
if (cup.startsWith("#")) {
cup = cup.substringAfter("#")
}
// Add support for Alpha format of percentage : 10%
if (cup.contains("%")) {
hasPercent = true
val alphaValueText = cup.substringBefore("%").trim()
if (alphaValueText.isNotEmpty()) {
val alphaValue = alphaValueText.toInt()
alpha = (alphaValue / 100.0 * 255).roundTo2HexString().toUpperCase()
percentAlpha = alphaValue
}
cup = cup.substringAfter("%")
}
when (cup.length) {
3 -> {
this.value = cup[0] + cup[0] + cup[1] + cup[1] + cup[2] + cup[2]
}
4 -> {
if (hasPercent) {
throw IllegalArgumentException("Length is weird")
}
this.value = cup[1] + cup[1] + cup[2] + cup[2] + cup[3] + cup[3]
this.alpha = cup[0] + cup[0]
}
6 -> {
this.value = cup
}
8 -> {
if (hasPercent) {
throw IllegalArgumentException("Length is weird")
}
this.value = cup.substring(2)
this.alpha = cup.substring(0, 2)
}
else -> throw IllegalArgumentException("Length is weird")
}
// if we survived till here, let's now check the format of the value itself
if (!VALUE_REGEX.matches(value)) {
throw IllegalArgumentException("The value $value is not of a correct format")
}
alpha?.let {
if (!ALPHA_REGEX.matches(it)) {
throw IllegalArgumentException("The alpha $alpha is not of a correct format")
}
if (!hasPercent) {
percentAlpha = (it.toInt(16) / 255.0).roundTo2Decimal()
}
}
}
fun rgb() = value.rgb()
fun hsl() = value.hsl()
override fun toString(): String = PREFIX + if (alpha == null) value else "$alpha$value"
companion object {
private const val PREFIX = "#"
private val VALUE_REGEX = Regex("[0-9a-fA-F]{6}$")
private val ALPHA_REGEX = Regex("[0-9a-fA-F]{2}$")
}
private operator fun Char.plus(c: Char): String {
return "$this$c"
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Hsl.kt
================================================
package il.co.galex.namethatcolor.core.model
data class Hsl(val h: Int, val s: Int, val l: Int)
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Rgb.kt
================================================
package il.co.galex.namethatcolor.core.model
data class Rgb(val r: Int, val g: Int, val b: Int) {
fun percent(): Triple<Double, Double, Double> = Triple(r / 255.0, g / 255.0, b / 255.0)
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/ColorExtensions.kt
================================================
package il.co.galex.namethatcolor.core.util
import il.co.galex.namethatcolor.core.model.Hsl
import il.co.galex.namethatcolor.core.model.Rgb
import il.co.galex.namethatcolor.plugin.util.ALPHA_SEPARATOR
import kotlin.math.roundToInt
/**
* Transforms a hexadecimal color like "8D90A1" to an Rgb(141, 144, 161)
*/
fun String.rgb() = Rgb(
r = this.substring(0, 2).toInt(16),
g = this.substring(2, 4).toInt(16),
b = this.substring(4, 6).toInt(16)
)
/**
* Transforms an hexadecimal color like "#8D90A1" to an Hsl(231, 10, 59)
* Based on http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/
*/
fun String.hsl(): Hsl {
val (r, g, b) = this.rgb().percent()
val min = minOf(r, b, g)
val max = maxOf(r, b, g)
val l = (min + max) / 2
if (min == max) {
return Hsl(0, 0, l.roundTo2Decimal())
} else {
//If Luminance is smaller then 0.5, then Saturation = (max-min)/(max+min)
//If Luminance is bigger then 0.5. then Saturation = ( max-min)/(2.0-max-min)
val s = if (l < 0.5) (max - min) / (max + min) else (max - min) / (2.0 - max - min)
//If Red is max, then Hue = (G-B)/(max-min)
//If Green is max, then Hue = 2.0 + (B-R)/(max-min)
//If Blue is max, then Hue = 4.0 + (R-G)/(max-min)
var h = when (max) {
r -> (g - b) / (max - min)
g -> 2.0 + (b - r) / (max - min)
b -> 4.0 + (r - g) / (max - min)
else -> throw IllegalStateException("no way")
}
h *= 60
if (h < 0) h += 360
return Hsl(h.roundToInt(), s.roundTo2Decimal(), l.roundTo2Decimal())
}
}
fun String.toXmlName(percentAlpha: Int?): String {
var name = this.toLowerCase().replace(" ", "_")
if (percentAlpha != null) {
name += "$ALPHA_SEPARATOR$percentAlpha"
}
return name
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Colors.kt
================================================
package il.co.galex.namethatcolor.core.util
import il.co.galex.namethatcolor.core.model.Color
/**
* List of colors
* Based on http://chir.ag/projects/ntc/ntc.js
*/
val colorsNames = mapOf(
"000000" to "Black",
"000080" to "Navy Blue",
"0000C8" to "Dark Blue",
"0000FF" to "Blue",
"000741" to "Stratos",
"001B1C" to "Swamp",
"002387" to "Resolution Blue",
"002900" to "Deep Fir",
"002E20" to "Burnham",
"002FA7" to "International Klein Blue",
"003153" to "Prussian Blue",
"003366" to "Midnight Blue",
"003399" to "Smalt",
"003532" to "Deep Teal",
"003E40" to "Cyprus",
"004620" to "Kaitoke Green",
"0047AB" to "Cobalt",
"004816" to "Crusoe",
"004950" to "Sherpa Blue",
"0056A7" to "Endeavour",
"00581A" to "Camarone",
"0066CC" to "Science Blue",
"0066FF" to "Blue Ribbon",
"00755E" to "Tropical Rain Forest",
"0076A3" to "Allports",
"007BA7" to "Deep Cerulean",
"007EC7" to "Lochmara",
"007FFF" to "Azure Radiance",
"008080" to "Teal",
"0095B6" to "Bondi Blue",
"009DC4" to "Pacific Blue",
"00A693" to "Persian Green",
"00A86B" to "Jade",
"00CC99" to "Caribbean Green",
"00CCCC" to "Robins Egg Blue",
"00FF00" to "Green",
"00FF7F" to "Spring Green",
"00FFFF" to "Cyan Aqua",
"010D1A" to "Blue Charcoal",
"011635" to "Midnight",
"011D13" to "Holly",
"012731" to "Daintree",
"01361C" to "Cardin Green",
"01371A" to "County Green",
"013E62" to "Astronaut Blue",
"013F6A" to "Regal Blue",
"014B43" to "Aqua Deep",
"015E85" to "Orient",
"016162" to "Blue Stone",
"016D39" to "Fun Green",
"01796F" to "Pine Green",
"017987" to "Blue Lagoon",
"01826B" to "Deep Sea",
"01A368" to "Green Haze",
"022D15" to "English Holly",
"02402C" to "Sherwood Green",
"02478E" to "Congress Blue",
"024E46" to "Evening Sea",
"026395" to "Bahama Blue",
"02866F" to "Observatory",
"02A4D3" to "Cerulean",
"03163C" to "Tangaroa",
"032B52" to "Green Vogue",
"036A6E" to "Mosque",
"041004" to "Midnight Moss",
"041322" to "Black Pearl",
"042E4C" to "Blue Whale",
"044022" to "Zuccini",
"044259" to "Teal Blue",
"051040" to "Deep Cove",
"051657" to "Gulf Blue",
"055989" to "Venice Blue",
"056F57" to "Watercourse",
"062A78" to "Catalina Blue",
"063537" to "Tiber",
"069B81" to "Gossamer",
"06A189" to "Niagara",
"073A50" to "Tarawera",
"080110" to "Jaguar",
"081910" to "Black Bean",
"082567" to "Deep Sapphire",
"088370" to "Elf Green",
"08E8DE" to "Bright Turquoise",
"092256" to "Downriver",
"09230F" to "Palm Green",
"09255D" to "Madison",
"093624" to "Bottle Green",
"095859" to "Deep Sea Green",
"097F4B" to "Salem",
"0A001C" to "Black Russian",
"0A480D" to "Dark Fern",
"0A6906" to "Japanese Laurel",
"0A6F75" to "Atoll",
"0B0B0B" to "Cod Gray",
"0B0F08" to "Marshland",
"0B1107" to "Gordons Green",
"0B1304" to "Black Forest",
"0B6207" to "San Felix",
"0BDA51" to "Malachite",
"0C0B1D" to "Ebony",
"0C0D0F" to "Woodsmoke",
"0C1911" to "Racing Green",
"0C7A79" to "Surfie Green",
"0C8990" to "Blue Chill",
"0D0332" to "Black Rock",
"0D1117" to "Bunker",
"0D1C19" to "Aztec",
"0D2E1C" to "Bush",
"0E0E18" to "Cinder",
"0E2A30" to "Firefly",
"0F2D9E" to "Torea Bay",
"10121D" to "Vulcan",
"101405" to "Green Waterloo",
"105852" to "Eden",
"110C6C" to "Arapawa",
"120A8F" to "Ultramarine",
"123447" to "Elephant",
"126B40" to "Jewel",
"130000" to "Diesel",
"130A06" to "Asphalt",
"13264D" to "Blue Zodiac",
"134F19" to "Parsley",
"140600" to "Nero",
"1450AA" to "Tory Blue",
"151F4C" to "Bunting",
"1560BD" to "Denim",
"15736B" to "Genoa",
"161928" to "Mirage",
"161D10" to "Hunter Green",
"162A40" to "Big Stone",
"163222" to "Celtic",
"16322C" to "Timber Green",
"163531" to "Gable Green",
"171F04" to "Pine Tree",
"175579" to "Chathams Blue",
"182D09" to "Deep Forest Green",
"18587A" to "Blumine",
"19330E" to "Palm Leaf",
"193751" to "Nile Blue",
"1959A8" to "Fun Blue",
"1A1A68" to "Lucky Point",
"1AB385" to "Mountain Meadow",
"1B0245" to "Tolopea",
"1B1035" to "Haiti",
"1B127B" to "Deep Koamaru",
"1B1404" to "Acadia",
"1B2F11" to "Seaweed",
"1B3162" to "Biscay",
"1B659D" to "Matisse",
"1C1208" to "Crowshead",
"1C1E13" to "Rangoon Green",
"1C39BB" to "Persian Blue",
"1C402E" to "Everglade",
"1C7C7D" to "Elm",
"1D6142" to "Green Pea",
"1E0F04" to "Creole",
"1E1609" to "Karaka",
"1E1708" to "El Paso",
"1E385B" to "Cello",
"1E433C" to "Te Papa Green",
"1E90FF" to "Dodger Blue",
"1E9AB0" to "Eastern Blue",
"1F120F" to "Night Rider",
"1FC2C2" to "Java",
"20208D" to "Jacksons Purple",
"202E54" to "Cloud Burst",
"204852" to "Blue Dianne",
"211A0E" to "Eternity",
"220878" to "Deep Blue",
"228B22" to "Forest Green",
"233418" to "Mallard",
"240A40" to "Violet",
"240C02" to "Kilamanjaro",
"242A1D" to "Log Cabin",
"242E16" to "Black Olive",
"24500F" to "Green House",
"251607" to "Graphite",
"251706" to "Cannon Black",
"251F4F" to "Port Gore",
"25272C" to "Shark",
"25311C" to "Green Kelp",
"2596D1" to "Curious Blue",
"260368" to "Paua",
"26056A" to "Paris M",
"261105" to "Wood Bark",
"261414" to "Gondola",
"262335" to "Steel Gray",
"26283B" to "Ebony Clay",
"273A81" to "Bay of Many",
"27504B" to "Plantation",
"278A5B" to "Eucalyptus",
"281E15" to "Oil",
"283A77" to "Astronaut",
"286ACD" to "Mariner",
"290C5E" to "Violent Violet",
"292130" to "Bastille",
"292319" to "Zeus",
"292937" to "Charade",
"297B9A" to "Jelly Bean",
"29AB87" to "Jungle Green",
"2A0359" to "Cherry Pie",
"2A140E" to "Coffee Bean",
"2A2630" to "Baltic Sea",
"2A380B" to "Turtle Green",
"2A52BE" to "Cerulean Blue",
"2B0202" to "Sepia Black",
"2B194F" to "Valhalla",
"2B3228" to "Heavy Metal",
"2C0E8C" to "Blue Gem",
"2C1632" to "Revolver",
"2C2133" to "Bleached Cedar",
"2C8C84" to "Lochinvar",
"2D2510" to "Mikado",
"2D383A" to "Outer Space",
"2D569B" to "St Tropaz",
"2E0329" to "Jacaranda",
"2E1905" to "Jacko Bean",
"2E3222" to "Rangitoto",
"2E3F62" to "Rhino",
"2E8B57" to "Sea Green",
"2EBFD4" to "Scooter",
"2F270E" to "Onion",
"2F3CB3" to "Governor Bay",
"2F519E" to "Sapphire",
"2F5A57" to "Spectra",
"2F6168" to "Casal",
"300529" to "Melanzane",
"301F1E" to "Cocoa Brown",
"302A0F" to "Woodrush",
"304B6A" to "San Juan",
"30D5C8" to "Turquoise",
"311C17" to "Eclipse",
"314459" to "Pickled Bluewood",
"315BA1" to "Azure",
"31728D" to "Calypso",
"317D82" to "Paradiso",
"32127A" to "Persian Indigo",
"32293A" to "Blackcurrant",
"323232" to "Mine Shaft",
"325D52" to "Stromboli",
"327C14" to "Bilbao",
"327DA0" to "Astral",
"33036B" to "Christalle",
"33292F" to "Thunder",
"33CC99" to "Shamrock",
"341515" to "Tamarind",
"350036" to "Mardi Gras",
"350E42" to "Valentino",
"350E57" to "Jagger",
"353542" to "Tuna",
"354E8C" to "Chambray",
"363050" to "Martinique",
"363534" to "Tuatara",
"363C0D" to "Waiouru",
"36747D" to "Ming",
"368716" to "La Palma",
"370202" to "Chocolate",
"371D09" to "Clinker",
"37290E" to "Brown Tumbleweed",
"373021" to "Birch",
"377475" to "Oracle",
"380474" to "Blue Diamond",
"381A51" to "Grape",
"383533" to "Dune",
"384555" to "Oxford Blue",
"384910" to "Clover",
"394851" to "Limed Spruce",
"396413" to "Dell",
"3A0020" to "Toledo",
"3A2010" to "Sambuca",
"3A2A6A" to "Jacarta",
"3A686C" to "William",
"3A6A47" to "Killarney",
"3AB09E" to "Keppel",
"3B000B" to "Temptress",
"3B0910" to "Aubergine",
"3B1F1F" to "Jon",
"3B2820" to "Treehouse",
"3B7A57" to "Amazon",
"3B91B4" to "Boston Blue",
"3C0878" to "Windsor",
"3C1206" to "Rebel",
"3C1F76" to "Meteorite",
"3C2005" to "Dark Ebony",
"3C3910" to "Camouflage",
"3C4151" to "Bright Gray",
"3C4443" to "Cape Cod",
"3C493A" to "Lunar Green",
"3D0C02" to "Bean ",
"3D2B1F" to "Bistre",
"3D7D52" to "Goblin",
"3E0480" to "Kingfisher Daisy",
"3E1C14" to "Cedar",
"3E2B23" to "English Walnut",
"3E2C1C" to "Black Marlin",
"3E3A44" to "Ship Gray",
"3EABBF" to "Pelorous",
"3F2109" to "Bronze",
"3F2500" to "Cola",
"3F3002" to "Madras",
"3F307F" to "Minsk",
"3F4C3A" to "Cabbage Pont",
"3F583B" to "Tom Thumb",
"3F5D53" to "Mineral Green",
"3FC1AA" to "Puerto Rico",
"3FFF00" to "Harlequin",
"401801" to "Brown Pod",
"40291D" to "Cork",
"403B38" to "Masala",
"403D19" to "Thatch Green",
"405169" to "Fiord",
"40826D" to "Viridian",
"40A860" to "Chateau Green",
"410056" to "Ripe Plum",
"411F10" to "Paco",
"412010" to "Deep Oak",
"413C37" to "Merlin",
"414257" to "Gun Powder",
"414C7D" to "East Bay",
"4169E1" to "Royal Blue",
"41AA78" to "Ocean Green",
"420303" to "Burnt Maroon",
"423921" to "Lisbon Brown",
"427977" to "Faded Jade",
"431560" to "Scarlet Gum",
"433120" to "Iroko",
"433E37" to "Armadillo",
"434C59" to "River Bed",
"436A0D" to "Green Leaf",
"44012D" to "Barossa",
"441D00" to "Morocco Brown",
"444954" to "Mako",
"454936" to "Kelp",
"456CAC" to "San Marino",
"45B1E8" to "Picton Blue",
"460B41" to "Loulou",
"462425" to "Crater Brown",
"465945" to "Gray Asparagus",
"4682B4" to "Steel Blue",
"480404" to "Rustic Red",
"480607" to "Bulgarian Rose",
"480656" to "Clairvoyant",
"481C1C" to "Cocoa Bean",
"483131" to "Woody Brown",
"483C32" to "Taupe",
"49170C" to "Van Cleef",
"492615" to "Brown Derby",
"49371B" to "Metallic Bronze",
"495400" to "Verdun Green",
"496679" to "Blue Bayoux",
"497183" to "Bismark",
"4A2A04" to "Bracken",
"4A3004" to "Deep Bronze",
"4A3C30" to "Mondo",
"4A4244" to "Tundora",
"4A444B" to "Gravel",
"4A4E5A" to "Trout",
"4B0082" to "Pigment Indigo",
"4B5D52" to "Nandor",
"4C3024" to "Saddle",
"4C4F56" to "Abbey",
"4D0135" to "Blackberry",
"4D0A18" to "Cab Sav",
"4D1E01" to "Indian Tan",
"4D282D" to "Cowboy",
"4D282E" to "Livid Brown",
"4D3833" to "Rock",
"4D3D14" to "Punga",
"4D400F" to "Bronzetone",
"4D5328" to "Woodland",
"4E0606" to "Mahogany",
"4E2A5A" to "Bossanova",
"4E3B41" to "Matterhorn",
"4E420C" to "Bronze Olive",
"4E4562" to "Mulled Wine",
"4E6649" to "Axolotl",
"4E7F9E" to "Wedgewood",
"4EABD1" to "Shakespeare",
"4F1C70" to "Honey Flower",
"4F2398" to "Daisy Bush",
"4F69C6" to "Indigo",
"4F7942" to "Fern Green",
"4F9D5D" to "Fruit Salad",
"4FA83D" to "Apple",
"504351" to "Mortar",
"507096" to "Kashmir Blue",
"507672" to "Cutty Sark",
"50C878" to "Emerald",
"514649" to "Emperor",
"516E3D" to "Chalet Green",
"517C66" to "Como",
"51808F" to "Smalt Blue",
"52001F" to "Castro",
"520C17" to "Maroon Oak",
"523C94" to "Gigas",
"533455" to "Voodoo",
"534491" to "Victoria",
"53824B" to "Hippie Green",
"541012" to "Heath",
"544333" to "Judge Gray",
"54534D" to "Fuscous Gray",
"549019" to "Vida Loca",
"55280C" to "Cioccolato",
"555B10" to "Saratoga",
"556D56" to "Finlandia",
"5590D9" to "Havelock Blue",
"56B4BE" to "Fountain Blue",
"578363" to "Spring Leaves",
"583401" to "Saddle Brown",
"585562" to "Scarpa Flow",
"587156" to "Cactus",
"589AAF" to "Hippie Blue",
"591D35" to "Wine Berry",
"592804" to "Brown Bramble",
"593737" to "Congo Brown",
"594433" to "Millbrook",
"5A6E9C" to "Waikawa Gray",
"5A87A0" to "Horizon",
"5B3013" to "Jambalaya",
"5C0120" to "Bordeaux",
"5C0536" to "Mulberry Wood",
"5C2E01" to "Carnaby Tan",
"5C5D75" to "Comet",
"5D1E0F" to "Redwood",
"5D4C51" to "Don Juan",
"5D5C58" to "Chicago",
"5D5E37" to "Verdigris",
"5D7747" to "Dingley",
"5DA19F" to "Breaker Bay",
"5E483E" to "Kabul",
"5E5D3B" to "Hemlock",
"5F3D26" to "Irish Coffee",
"5F5F6E" to "Mid Gray",
"5F6672" to "Shuttle Gray",
"5FA777" to "Aqua Forest",
"5FB3AC" to "Tradewind",
"604913" to "Horses Neck",
"605B73" to "Smoky",
"606E68" to "Corduroy",
"6093D1" to "Danube",
"612718" to "Espresso",
"614051" to "Eggplant",
"615D30" to "Costa Del Sol",
"61845F" to "Glade Green",
"622F30" to "Buccaneer",
"623F2D" to "Quincy",
"624E9A" to "Butterfly Bush",
"625119" to "West Coast",
"626649" to "Finch",
"639A8F" to "Patina",
"63B76C" to "Fern",
"6456B7" to "Blue Violet",
"646077" to "Dolphin",
"646463" to "Storm Dust",
"646A54" to "Siam",
"646E75" to "Nevada",
"6495ED" to "Cornflower Blue",
"64CCDB" to "Viking",
"65000B" to "Rosewood",
"651A14" to "Cherrywood",
"652DC1" to "Purple Heart",
"657220" to "Fern Frond",
"65745D" to "Willow Grove",
"65869F" to "Hoki",
"660045" to "Pompadour",
"660099" to "Purple",
"66023C" to "Tyrian Purple",
"661010" to "Dark Tan",
"66B58F" to "Silver Tree",
"66FF00" to "Bright Green",
"66FF66" to "Screamin Green",
"67032D" to "Black Rose",
"675FA6" to "Scampi",
"676662" to "Ironside Gray",
"678975" to "Viridian Green",
"67A712" to "Christi",
"683600" to "Nutmeg Wood Finish",
"685558" to "Zambezi",
"685E6E" to "Salt Box",
"692545" to "Tawny Port",
"692D54" to "Finn",
"695F62" to "Scorpion",
"697E9A" to "Lynch",
"6A442E" to "Spice",
"6A5D1B" to "Himalaya",
"6A6051" to "Soya Bean",
"6B2A14" to "Hairy Heath",
"6B3FA0" to "Royal Purple",
"6B4E31" to "Shingle Fawn",
"6B5755" to "Dorado",
"6B8BA2" to "Bermuda Gray",
"6B8E23" to "Olive Drab",
"6C3082" to "Eminence",
"6CDAE7" to "Turquoise Blue",
"6D0101" to "Lonestar",
"6D5E54" to "Pine Cone",
"6D6C6C" to "Dove Gray",
"6D9292" to "Juniper",
"6D92A1" to "Gothic",
"6E0902" to "Red Oxide",
"6E1D14" to "Moccaccino",
"6E4826" to "Pickled Bean",
"6E4B26" to "Dallas",
"6E6D57" to "Kokoda",
"6E7783" to "Pale Sky",
"6F440C" to "Cafe Royale",
"6F6A61" to "Flint",
"6F8E63" to "Highland",
"6F9D02" to "Limeade",
"6FD0C5" to "Downy",
"701C1C" to "Persian Plum",
"704214" to "Sepia",
"704A07" to "Antique Bronze",
"704F50" to "Ferra",
"706555" to "Coffee",
"708090" to "Slate Gray",
"711A00" to "Cedar Wood Finish",
"71291D" to "Metallic Copper",
"714693" to "Affair",
"714AB2" to "Studio",
"715D47" to "Tobacco Brown",
"716338" to "Yellow Metal",
"716B56" to "Peat",
"716E10" to "Olivetone",
"717486" to "Storm Gray",
"718080" to "Sirocco",
"71D9E2" to "Aquamarine Blue",
"72010F" to "Venetian Red",
"724A2F" to "Old Copper",
"726D4E" to "Go Ben",
"727B89" to "Raven",
"731E8F" to "Seance",
"734A12" to "Raw Umber",
"736C9F" to "Kimberly",
"736D58" to "Crocodile",
"737829" to "Crete",
"738678" to "Xanadu",
"74640D" to "Spicy Mustard",
"747D63" to "Limed Ash",
"747D83" to "Rolling Stone",
"748881" to "Blue Smoke",
"749378" to "Laurel",
"74C365" to "Mantis",
"755A57" to "Russett",
"7563A8" to "Deluge",
"76395D" to "Cosmic",
"7666C6" to "Blue Marguerite",
"76BD17" to "Lima",
"76D7EA" to "Sky Blue",
"770F05" to "Dark Burgundy",
"771F1F" to "Crown of Thorns",
"773F1A" to "Walnut",
"776F61" to "Pablo",
"778120" to "Pacifika",
"779E86" to "Oxley",
"77DD77" to "Pastel Green",
"780109" to "Japanese Maple",
"782D19" to "Mocha",
"782F16" to "Peanut",
"78866B" to "Camouflage Green",
"788A25" to "Wasabi",
"788BBA" to "Ship Cove",
"78A39C" to "Sea Nymph",
"795D4C" to "Roman Coffee",
"796878" to "Old Lavender",
"796989" to "Rum",
"796A78" to "Fedora",
"796D62" to "Sandstone",
"79DEEC" to "Spray",
"7A013A" to "Siren",
"7A58C1" to "Fuchsia Blue",
"7A7A7A" to "Boulder",
"7A89B8" to "Wild Blue Yonder",
"7AC488" to "De York",
"7B3801" to "Red Beech",
"7B3F00" to "Cinnamon",
"7B6608" to "Yukon Gold",
"7B7874" to "Tapa",
"7B7C94" to "Waterloo ",
"7B8265" to "Flax Smoke",
"7B9F80" to "Amulet",
"7BA05B" to "Asparagus",
"7C1C05" to "Kenyan Copper",
"7C7631" to "Pesto",
"7C778A" to "Topaz",
"7C7B7A" to "Concord",
"7C7B82" to "Jumbo",
"7C881A" to "Trendy Green",
"7CA1A6" to "Gumbo",
"7CB0A1" to "Acapulco",
"7CB7BB" to "Neptune",
"7D2C14" to "Pueblo",
"7DA98D" to "Bay Leaf",
"7DC8F7" to "Malibu",
"7DD8C6" to "Bermuda",
"7E3A15" to "Copper Canyon",
"7F1734" to "Claret",
"7F3A02" to "Peru Tan",
"7F626D" to "Falcon",
"7F7589" to "Mobster",
"7F76D3" to "Moody Blue",
"7FFF00" to "Chartreuse",
"7FFFD4" to "Aquamarine",
"800000" to "Maroon",
"800B47" to "Rose Bud Cherry",
"801818" to "Falu Red",
"80341F" to "Red Robin",
"803790" to "Vivid Violet",
"80461B" to "Russet",
"807E79" to "Friar Gray",
"808000" to "Olive",
"808080" to "Gray",
"80B3AE" to "Gulf Stream",
"80B3C4" to "Glacier",
"80CCEA" to "Seagull",
"81422C" to "Nutmeg",
"816E71" to "Spicy Pink",
"817377" to "Empress",
"819885" to "Spanish Green",
"826F65" to "Sand Dune",
"828685" to "Gunsmoke",
"828F72" to "Battleship Gray",
"831923" to "Merlot",
"837050" to "Shadow",
"83AA5D" to "Chelsea Cucumber",
"83D0C6" to "Monte Carlo",
"843179" to "Plum",
"84A0A0" to "Granny Smith",
"8581D9" to "Chetwode Blue",
"858470" to "Bandicoot",
"859FAF" to "Bali Hai",
"85C4CC" to "Half Baked",
"860111" to "Red Devil",
"863C3C" to "Lotus",
"86483C" to "Ironstone",
"864D1E" to "Bull Shot",
"86560A" to "Rusty Nail",
"868974" to "Bitter",
"86949F" to "Regent Gray",
"871550" to "Disco",
"87756E" to "Americano",
"877C7B" to "Hurricane",
"878D91" to "Oslo Gray",
"87AB39" to "Sushi",
"885342" to "Spicy Mix",
"886221" to "Kumera",
"888387" to "Suva Gray",
"888D65" to "Avocado",
"893456" to "Camelot",
"893843" to "Solid Pink",
"894367" to "Cannon Pink",
"897D6D" to "Makara",
"8A3324" to "Burnt Umber",
"8A73D6" to "True V",
"8A8360" to "Clay Creek",
"8A8389" to "Monsoon",
"8A8F8A" to "Stack",
"8AB9F1" to "Jordy Blue",
"8B00FF" to "Electric Violet",
"8B0723" to "Monarch",
"8B6B0B" to "Corn Harvest",
"8B8470" to "Olive Haze",
"8B847E" to "Schooner",
"8B8680" to "Natural Gray",
"8B9C90" to "Mantle",
"8B9FEE" to "Portage",
"8BA690" to "Envy",
"8BA9A5" to "Cascade",
"8BE6D8" to "Riptide",
"8C055E" to "Cardinal Pink",
"8C472F" to "Mule Fawn",
"8C5738" to "Potters Clay",
"8C6495" to "Trendy Pink",
"8D0226" to "Paprika",
"8D3D38" to "Sanguine Brown",
"8D3F3F" to "Tosca",
"8D7662" to "Cement",
"8D8974" to "Granite Green",
"8D90A1" to "Manatee",
"8DA8CC" to "Polo Blue",
"8E0000" to "Red Berry",
"8E4D1E" to "Rope",
"8E6F70" to "Opium",
"8E775E" to "Domino",
"8E8190" to "Mamba",
"8EABC1" to "Nepal",
"8F021C" to "Pohutukawa",
"8F3E33" to "El Salva",
"8F4B0E" to "Korma",
"8F8176" to "Squirrel",
"8FD6B4" to "Vista Blue",
"900020" to "Burgundy",
"901E1E" to "Old Brick",
"907874" to "Hemp",
"907B71" to "Almond Frost",
"908D39" to "Sycamore",
"92000A" to "Sangria",
"924321" to "Cumin",
"926F5B" to "Beaver",
"928573" to "Stonewall",
"928590" to "Venus",
"9370DB" to "Medium Purple",
"93CCEA" to "Cornflower",
"93DFB8" to "Algae Green",
"944747" to "Copper Rust",
"948771" to "Arrowtown",
"950015" to "Scarlett",
"956387" to "Strikemaster",
"959396" to "Mountain Mist",
"960018" to "Carmine",
"964B00" to "Brown",
"967059" to "Leather",
"9678B6" to "Purple Mountains Majesty",
"967BB6" to "Lavender Purple",
"96A8A1" to "Pewter",
"96BBAB" to "Summer Green",
"97605D" to "Au Chico",
"9771B5" to "Wisteria",
"97CD2D" to "Atlantis",
"983D61" to "Vin Rouge",
"9874D3" to "Lilac Bush",
"98777B" to "Bazaar",
"98811B" to "Hacienda",
"988D77" to "Pale Oyster",
"98FF98" to "Mint Green",
"990066" to "Fresh Eggplant",
"991199" to "Violet Eggplant",
"991613" to "Tamarillo",
"991B07" to "Totem Pole",
"996666" to "Copper Rose",
"9966CC" to "Amethyst",
"997A8D" to "Mountbatten Pink",
"9999CC" to "Blue Bell",
"9A3820" to "Prairie Sand",
"9A6E61" to "Toast",
"9A9577" to "Gurkha",
"9AB973" to "Olivine",
"9AC2B8" to "Shadow Green",
"9B4703" to "Oregon",
"9B9E8F" to "Lemon Grass",
"9C3336" to "Stiletto",
"9D5616" to "Hawaiian Tan",
"9DACB7" to "Gull Gray",
"9DC209" to "Pistachio",
"9DE093" to "Granny Smith Apple",
"9DE5FF" to "Anakiwa",
"9E5302" to "Chelsea Gem",
"9E5B40" to "Sepia Skin",
"9EA587" to "Sage",
"9EA91F" to "Citron",
"9EB1CD" to "Rock Blue",
"9EDEE0" to "Morning Glory",
"9F381D" to "Cognac",
"9F821C" to "Reef Gold",
"9F9F9C" to "Star Dust",
"9FA0B1" to "Santas Gray",
"9FD7D3" to "Sinbad",
"9FDD8C" to "Feijoa",
"A02712" to "Tabasco",
"A1750D" to "Buttered Rum",
"A1ADB5" to "Hit Gray",
"A1C50A" to "Citrus",
"A1DAD7" to "Aqua Island",
"A1E9DE" to "Water Leaf",
"A2006D" to "Flirt",
"A23B6C" to "Rouge",
"A26645" to "Cape Palliser",
"A2AAB3" to "Gray Chateau",
"A2AEAB" to "Edward",
"A3807B" to "Pharlap",
"A397B4" to "Amethyst Smoke",
"A3E3ED" to "Blizzard Blue",
"A4A49D" to "Delta",
"A4A6D3" to "Wistful",
"A4AF6E" to "Green Smoke",
"A50B5E" to "Jazzberry Jam",
"A59B91" to "Zorba",
"A5CB0C" to "Bahia",
"A62F20" to "Roof Terracotta",
"A65529" to "Paarl",
"A68B5B" to "Barley Corn",
"A69279" to "Donkey Brown",
"A6A29A" to "Dawn",
"A72525" to "Mexican Red",
"A7882C" to "Luxor Gold",
"A85307" to "Rich Gold",
"A86515" to "Reno Sand",
"A86B6B" to "Coral Tree",
"A8989B" to "Dusty Gray",
"A899E6" to "Dull Lavender",
"A8A589" to "Tallow",
"A8AE9C" to "Bud",
"A8AF8E" to "Locust",
"A8BD9F" to "Norway",
"A8E3BD" to "Chinook",
"A9A491" to "Gray Olive",
"A9ACB6" to "Aluminium",
"A9B2C3" to "Cadet Blue",
"A9B497" to "Schist",
"A9BDBF" to "Tower Gray",
"A9BEF2" to "Perano",
"A9C6C2" to "Opal",
"AA375A" to "Night Shadz",
"AA4203" to "Fire",
"AA8B5B" to "Muesli",
"AA8D6F" to "Sandal",
"AAA5A9" to "Shady Lady",
"AAA9CD" to "Logan",
"AAABB7" to "Spun Pearl",
"AAD6E6" to "Regent St Blue",
"AAF0D1" to "Magic Mint",
"AB0563" to "Lipstick",
"AB3472" to "Royal Heath",
"AB917A" to "Sandrift",
"ABA0D9" to "Cold Purple",
"ABA196" to "Bronco",
"AC8A56" to "Limed Oak",
"AC91CE" to "East Side",
"AC9E22" to "Lemon Ginger",
"ACA494" to "Napa",
"ACA586" to "Hillary",
"ACA59F" to "Cloudy",
"ACACAC" to "Silver Chalice",
"ACB78E" to "Swamp Green",
"ACCBB1" to "Spring Rain",
"ACDD4D" to "Conifer",
"ACE1AF" to "Celadon",
"AD781B" to "Mandalay",
"ADBED1" to "Casper",
"ADDFAD" to "Moss Green",
"ADE6C4" to "Padua",
"ADFF2F" to "Green Yellow",
"AE4560" to "Hippie Pink",
"AE6020" to "Desert",
"AE809E" to "Bouquet",
"AF4035" to "Medium Carmine",
"AF4D43" to "Apple Blossom",
"AF593E" to "Brown Rust",
"AF8751" to "Driftwood",
"AF8F2C" to "Alpine",
"AF9F1C" to "Lucky",
"AFA09E" to "Martini",
"AFB1B8" to "Bombay",
"AFBDD9" to "Pigeon Post",
"B04C6A" to "Cadillac",
"B05D54" to "Matrix",
"B05E81" to "Tapestry",
"B06608" to "Mai Tai",
"B09A95" to "Del Rio",
"B0E0E6" to "Powder Blue",
"B0E313" to "Inch Worm",
"B10000" to "Bright Red",
"B14A0B" to "Vesuvius",
"B1610B" to "Pumpkin Skin",
"B16D52" to "Santa Fe",
"B19461" to "Teak",
"B1E2C1" to "Fringy Flower",
"B1F4E7" to "Ice Cold",
"B20931" to "Shiraz",
"B2A1EA" to "Biloba Flower",
"B32D29" to "Tall Poppy",
"B35213" to "Fiery Orange",
"B38007" to "Hot Toddy",
"B3AF95" to "Taupe Gray",
"B3C110" to "La Rioja",
"B43332" to "Well Read",
"B44668" to "Blush",
"B4CFD3" to "Jungle Mist",
"B57281" to "Turkish Rose",
"B57EDC" to "Lavender",
"B5A27F" to "Mongoose",
"B5B35C" to "Olive Green",
"B5D2CE" to "Jet Stream",
"B5ECDF" to "Cruise",
"B6316C" to "Hibiscus",
"B69D98" to "Thatch",
"B6B095" to "Heathered Gray",
"B6BAA4" to "Eagle",
"B6D1EA" to "Spindle",
"B6D3BF" to "Gum Leaf",
"B7410E" to "Rust",
"B78E5C" to "Muddy Waters",
"B7A214" to "Sahara",
"B7A458" to "Husk",
"B7B1B1" to "Nobel",
"B7C3D0" to "Heather",
"B7F0BE" to "Madang",
"B81104" to "Milano Red",
"B87333" to "Copper",
"B8B56A" to "Gimblet",
"B8C1B1" to "Green Spring",
"B8C25D" to "Celery",
"B8E0F9" to "Sail",
"B94E48" to "Chestnut",
"B95140" to "Crail",
"B98D28" to "Marigold",
"B9C46A" to "Wild Willow",
"B9C8AC" to "Rainee",
"BA0101" to "Guardsman Red",
"BA450C" to "Rock Spray",
"BA6F1E" to "Bourbon",
"BA7F03" to "Pirate Gold",
"BAB1A2" to "Nomad",
"BAC7C9" to "Submarine",
"BAEEF9" to "Charlotte",
"BB3385" to "Medium Red Violet",
"BB8983" to "Brandy Rose",
"BBD009" to "Rio Grande",
"BBD7C1" to "Surf",
"BCC9C2" to "Powder Ash",
"BD5E2E" to "Tuscany",
"BD978E" to "Quicksand",
"BDB1A8" to "Silk",
"BDB2A1" to "Malta",
"BDB3C7" to "Chatelle",
"BDBBD7" to "Lavender Gray",
"BDBDC6" to "French Gray",
"BDC8B3" to "Clay Ash",
"BDC9CE" to "Loblolly",
"BDEDFD" to "French Pass",
"BEA6C3" to "London Hue",
"BEB5B7" to "Pink Swan",
"BEDE0D" to "Fuego",
"BF5500" to "Rose of Sharon",
"BFB8B0" to "Tide",
"BFBED8" to "Blue Haze",
"BFC1C2" to "Silver Sand",
"BFC921" to "Key Lime Pie",
"BFDBE2" to "Ziggurat",
"BFFF00" to "Lime",
"C02B18" to "Thunderbird",
"C04737" to "Mojo",
"C08081" to "Old Rose",
"C0C0C0" to "Silver",
"C0D3B9" to "Pale Leaf",
"C0D8B6" to "Pixie Green",
"C1440E" to "Tia Maria",
"C154C1" to "Fuchsia Pink",
"C1A004" to "Buddha Gold",
"C1B7A4" to "Bison Hide",
"C1BAB0" to "Tea",
"C1BECD" to "Gray Suit",
"C1D7B0" to "Sprout",
"C1F07C" to "Sulu",
"C26B03" to "Indochine",
"C2955D" to "Twine",
"C2BDB6" to "Cotton Seed",
"C2CAC4" to "Pumice",
"C2E8E5" to "Jagged Ice",
"C32148" to "Maroon Flush",
"C3B091" to "Indian Khaki",
"C3BFC1" to "Pale Slate",
"C3C3BD" to "Gray Nickel",
"C3CDE6" to "Periwinkle Gray",
"C3D1D1" to "Tiara",
"C3DDF9" to "Tropical Blue",
"C41E3A" to "Cardinal",
"C45655" to "Fuzzy Wuzzy Brown",
"C45719" to "Orange Roughy",
"C4C4BC" to "Mist Gray",
"C4D0B0" to "Coriander",
"C4F4EB" to "Mint Tulip",
"C54B8C" to "Mulberry",
"C59922" to "Nugget",
"C5994B" to "Tussock",
"C5DBCA" to "Sea Mist",
"C5E17A" to "Yellow Green",
"C62D42" to "Brick Red",
"C6726B" to "Contessa",
"C69191" to "Oriental Pink",
"C6A84B" to "Roti",
"C6C3B5" to "Ash",
"C6C8BD" to "Kangaroo",
"C6E610" to "Las Palmas",
"C7031E" to "Monza",
"C71585" to "Red Violet",
"C7BCA2" to "Coral Reef",
"C7C1FF" to "Melrose",
"C7C4BF" to "Cloud",
"C7C9D5" to "Ghost",
"C7CD90" to "Pine Glade",
"C7DDE5" to "Botticelli",
"C88A65" to "Antique Brass",
"C8A2C8" to "Lilac",
"C8A528" to "Hokey Pokey",
"C8AABF" to "Lily",
"C8B568" to "Laser",
"C8E3D7" to "Edgewater",
"C96323" to "Piper",
"C99415" to "Pizza",
"C9A0DC" to "Light Wisteria",
"C9B29B" to "Rodeo Dust",
"C9B35B" to "Sundance",
"C9B93B" to "Earls Green",
"C9C0BB" to "Silver Rust",
"C9D9D2" to "Conch",
"C9FFA2" to "Reef",
"C9FFE5" to "Aero Blue",
"CA3435" to "Flush Mahogany",
"CABB48" to "Turmeric",
"CADCD4" to "Paris White",
"CAE00D" to "Bitter Lemon",
"CAE6DA" to "Skeptic",
"CB8FA9" to "Viola",
"CBCAB6" to "Foggy Gray",
"CBD3B0" to "Green Mist",
"CBDBD6" to "Nebula",
"CC3333" to "Persian Red",
"CC5500" to "Burnt Orange",
"CC7722" to "Ochre",
"CC8899" to "Puce",
"CCCAA8" to "Thistle Green",
"CCCCFF" to "Periwinkle",
"CCFF00" to "Electric Lime",
"CD5700" to "Tenn",
"CD5C5C" to "Chestnut Rose",
"CD8429" to "Brandy Punch",
"CDF4FF" to "Onahau",
"CEB98F" to "Sorrell Brown",
"CEBABA" to "Cold Turkey",
"CEC291" to "Yuma",
"CEC7A7" to "Chino",
"CFA39D" to "Eunry",
"CFB53B" to "Old Gold",
"CFDCCF" to "Tasman",
"CFE5D2" to "Surf Crest",
"CFF9F3" to "Humming Bird",
"CFFAF4" to "Scandal",
"D05F04" to "Red Stage",
"D06DA1" to "Hopbush",
"D07D12" to "Meteor",
"D0BEF8" to "Perfume",
"D0C0E5" to "Prelude",
"D0F0C0" to "Tea Green",
"D18F1B" to "Geebung",
"D1BEA8" to "Vanilla",
"D1C6B4" to "Soft Amber",
"D1D2CA" to "Celeste",
"D1D2DD" to "Mischka",
"D1E231" to "Pear",
"D2691E" to "Hot Cinnamon",
"D27D46" to "Raw Sienna",
"D29EAA" to "Careys Pink",
"D2B48C" to "Tan",
"D2DA97" to "Deco",
"D2F6DE" to "Blue Romance",
"D2F8B0" to "Gossip",
"D3CBBA" to "Sisal",
"D3CDC5" to "Swirl",
"D47494" to "Charm",
"D4B6AF" to "Clam Shell",
"D4BF8D" to "Straw",
"D4C4A8" to "Akaroa",
"D4CD16" to "Bird Flower",
"D4D7D9" to "Iron",
"D4DFE2" to "Geyser",
"D4E2FC" to "Hawkes Blue",
"D54600" to "Grenadier",
"D591A4" to "Can Can",
"D59A6F" to "Whiskey",
"D5D195" to "Winter Hazel",
"D5F6E3" to "Granny Apple",
"D69188" to "My Pink",
"D6C562" to "Tacha",
"D6CEF6" to "Moon Raker",
"D6D6D1" to "Quill Gray",
"D6FFDB" to "Snowy Mint",
"D7837F" to "New York Pink",
"D7C498" to "Pavlova",
"D7D0FF" to "Fog",
"D84437" to "Valencia",
"D87C63" to "Japonica",
"D8BFD8" to "Thistle",
"D8C2D5" to "Maverick",
"D8FCFA" to "Foam",
"D94972" to "Cabaret",
"D99376" to "Burning Sand",
"D9B99B" to "Cameo",
"D9D6CF" to "Timberwolf",
"D9DCC1" to "Tana",
"D9E4F5" to "Link Water",
"D9F7FF" to "Mabel",
"DA3287" to "Cerise",
"DA5B38" to "Flame Pea",
"DA6304" to "Bamboo",
"DA6A41" to "Red Damask",
"DA70D6" to "Orchid",
"DA8A67" to "Copperfield",
"DAA520" to "Golden Grass",
"DAECD6" to "Zanah",
"DAF4F0" to "Iceberg",
"DAFAFF" to "Oyster Bay",
"DB5079" to "Cranberry",
"DB9690" to "Petite Orchid",
"DB995E" to "Di Serria",
"DBDBDB" to "Alto",
"DBFFF8" to "Frosted Mint",
"DC143C" to "Crimson",
"DC4333" to "Punch",
"DCB20C" to "Galliano",
"DCB4BC" to "Blossom",
"DCD747" to "Wattle",
"DCD9D2" to "Westar",
"DCDDCC" to "Moon Mist",
"DCEDB4" to "Caper",
"DCF0EA" to "Swans Down",
"DDD6D5" to "Swiss Coffee",
"DDF9F1" to "White Ice",
"DE3163" to "Cerise Red",
"DE6360" to "Roman",
"DEA681" to "Tumbleweed",
"DEBA13" to "Gold Tips",
"DEC196" to "Brandy",
"DECBC6" to "Wafer",
"DED4A4" to "Sapling",
"DED717" to "Barberry",
"DEE5C0" to "Beryl Green",
"DEF5FF" to "Pattens Blue",
"DF73FF" to "Heliotrope",
"DFBE6F" to "Apache",
"DFCD6F" to "Chenin",
"DFCFDB" to "Lola",
"DFECDA" to "Willow Brook",
"DFFF00" to "Chartreuse Yellow",
"E0B0FF" to "Mauve",
"E0B646" to "Anzac",
"E0B974" to "Harvest Gold",
"E0C095" to "Calico",
"E0FFFF" to "Baby Blue",
"E16865" to "Sunglo",
"E1BC64" to "Equator",
"E1C0C8" to "Pink Flare",
"E1E6D6" to "Periglacial Blue",
"E1EAD4" to "Kidnapper",
"E1F6E8" to "Tara",
"E25465" to "Mandy",
"E2725B" to "Terracotta",
"E28913" to "Golden Bell",
"E292C0" to "Shocking",
"E29418" to "Dixie",
"E29CD2" to "Light Orchid",
"E2D8ED" to "Snuff",
"E2EBED" to "Mystic",
"E2F3EC" to "Apple Green",
"E30B5C" to "Razzmatazz",
"E32636" to "Alizarin Crimson",
"E34234" to "Cinnabar",
"E3BEBE" to "Cavern Pink",
"E3F5E1" to "Peppermint",
"E3F988" to "Mindaro",
"E47698" to "Deep Blush",
"E49B0F" to "Gamboge",
"E4C2D5" to "Melanie",
"E4CFDE" to "Twilight",
"E4D1C0" to "Bone",
"E4D422" to "Sunflower",
"E4D5B7" to "Grain Brown",
"E4D69B" to "Zombie",
"E4F6E7" to "Frostee",
"E4FFD1" to "Snow Flurry",
"E52B50" to "Amaranth",
"E5841B" to "Zest",
"E5CCC9" to "Dust Storm",
"E5D7BD" to "Stark White",
"E5D8AF" to "Hampton",
"E5E0E1" to "Bon Jour",
"E5E5E5" to "Mercury",
"E5F9F6" to "Polar",
"E64E03" to "Trinidad",
"E6BE8A" to "Gold Sand",
"E6BEA5" to "Cashmere",
"E6D7B9" to "Double Spanish White",
"E6E4D4" to "Satin Linen",
"E6F2EA" to "Harp",
"E6F8F3" to "Off Green",
"E6FFE9" to "Hint of Green",
"E6FFFF" to "Tranquil",
"E77200" to "Mango Tango",
"E7730A" to "Christine",
"E79F8C" to "Tonys Pink",
"E79FC4" to "Kobi",
"E7BCB4" to "Rose Fog",
"E7BF05" to "Corn",
"E7CD8C" to "Putty",
"E7ECE6" to "Gray Nurse",
"E7F8FF" to "Lily White",
"E7FEFF" to "Bubbles",
"E89928" to "Fire Bush",
"E8B9B3" to "Shilo",
"E8E0D5" to "Pearl Bush",
"E8EBE0" to "Green White",
"E8F1D4" to "Chrome White",
"E8F2EB" to "Gin",
"E8F5F2" to "Aqua Squeeze",
"E96E00" to "Clementine",
"E97451" to "Burnt Sienna",
"E97C07" to "Tahiti Gold",
"E9CECD" to "Oyster Pink",
"E9D75A" to "Confetti",
"E9E3E3" to "Ebb",
"E9F8ED" to "Ottoman",
"E9FFFD" to "Clear Day",
"EA88A8" to "Carissma",
"EAAE69" to "Porsche",
"EAB33B" to "Tulip Tree",
"EAC674" to "Rob Roy",
"EADAB8" to "Raffia",
"EAE8D4" to "White Rock",
"EAF6EE" to "Panache",
"EAF6FF" to "Solitude",
"EAF9F5" to "Aqua Spring",
"EAFFFE" to "Dew",
"EB9373" to "Apricot",
"EBC2AF" to "Zinnwaldite",
"ECA927" to "Fuel Yellow",
"ECC54E" to "Ronchi",
"ECC7EE" to "French Lilac",
"ECCDB9" to "Just Right",
"ECE090" to "Wild Rice",
"ECEBBD" to "Fall Green",
"ECEBCE" to "Aths Special",
"ECF245" to "Starship",
"ED0A3F" to "Red Ribbon",
"ED7A1C" to "Tango",
"ED9121" to "Carrot Orange",
"ED989E" to "Sea Pink",
"EDB381" to "Tacao",
"EDC9AF" to "Desert Sand",
"EDCDAB" to "Pancho",
"EDDCB1" to "Chamois",
"EDEA99" to "Primrose",
"EDF5DD" to "Frost",
"EDF5F5" to "Aqua Haze",
"EDF6FF" to "Zumthor",
"EDF9F1" to "Narvik",
"EDFC84" to "Honeysuckle",
"EE82EE" to "Lavender Magenta",
"EEC1BE" to "Beauty Bush",
"EED794" to "Chalky",
"EED9C4" to "Almond",
"EEDC82" to "Flax",
"EEDEDA" to "Bizarre",
"EEE3AD" to "Double Colonial White",
"EEEEE8" to "Cararra",
"EEEF78" to "Manz",
"EEF0C8" to "Tahuna Sands",
"EEF0F3" to "Athens Gray",
"EEF3C3" to "Tusk",
"EEF4DE" to "Loafer",
"EEF6F7" to "Catskill White",
"EEFDFF" to "Twilight Blue",
"EEFF9A" to "Jonquil",
"EEFFE2" to "Rice Flower",
"EF863F" to "Jaffa",
"EFEFEF" to "Gallery",
"EFF2F3" to "Porcelain",
"F091A9" to "Mauvelous",
"F0D52D" to "Golden Dream",
"F0DB7D" to "Golden Sand",
"F0DC82" to "Buff",
"F0E2EC" to "Prim",
"F0E68C" to "Khaki",
"F0EEFD" to "Selago",
"F0EEFF" to "Titan White",
"F0F8FF" to "Alice Blue",
"F0FCEA" to "Feta",
"F18200" to "Gold Drop",
"F19BAB" to "Wewak",
"F1E788" to "Sahara Sand",
"F1E9D2" to "Parchment",
"F1E9FF" to "Blue Chalk",
"F1EEC1" to "Mint Julep",
"F1F1F1" to "Seashell",
"F1F7F2" to "Saltpan",
"F1FFAD" to "Tidal",
"F1FFC8" to "Chiffon",
"F2552A" to "Flamingo",
"F28500" to "Tangerine",
"F2C3B2" to "Mandys Pink",
"F2F2F2" to "Concrete",
"F2FAFA" to "Black Squeeze",
"F34723" to "Pomegranate",
"F3AD16" to "Buttercup",
"F3D69D" to "New Orleans",
"F3D9DF" to "Vanilla Ice",
"F3E7BB" to "Sidecar",
"F3E9E5" to "Dawn Pink",
"F3EDCF" to "Wheatfield",
"F3FB62" to "Canary",
"F3FBD4" to "Orinoco",
"F3FFD8" to "Carla",
"F400A1" to "Hollywood Cerise",
"F4A460" to "Sandy brown",
"F4C430" to "Saffron",
"F4D81C" to "Ripe Lemon",
"F4EBD3" to "Janna",
"F4F2EE" to "Pampas",
"F4F4F4" to "Wild Sand",
"F4F8FF" to "Zircon",
"F57584" to "Froly",
"F5C85C" to "Cream Can",
"F5C999" to "Manhattan",
"F5D5A0" to "Maize",
"F5DEB3" to "Wheat",
"F5E7A2" to "Sandwisp",
"F5E7E2" to "Pot Pourri",
"F5E9D3" to "Albescent White",
"F5EDEF" to "Soft Peach",
"F5F3E5" to "Ecru White",
"F5F5DC" to "Beige",
"F5FB3D" to "Golden Fizz",
"F5FFBE" to "Australian Mint",
"F64A8A" to "French Rose",
"F653A6" to "Brilliant Rose",
"F6A4C9" to "Illusion",
"F6F0E6" to "Merino",
"F6F7F7" to "Black Haze",
"F6FFDC" to "Spring Sun",
"F7468A" to "Violet Red",
"F77703" to "Chilean Fire",
"F77FBE" to "Persian Pink",
"F7B668" to "Rajah",
"F7C8DA" to "Azalea",
"F7DBE6" to "We Peep",
"F7F2E1" to "Quarter Spanish White",
"F7F5FA" to "Whisper",
"F7FAF7" to "Snow Drift",
"F8B853" to "Casablanca",
"F8C3DF" to "Chantilly",
"F8D9E9" to "Cherub",
"F8DB9D" to "Marzipan",
"F8DD5C" to "Energy Yellow",
"F8E4BF" to "Givry",
"F8F0E8" to "White Linen",
"F8F4FF" to "Magnolia",
"F8F6F1" to "Spring Wood",
"F8F7DC" to "Coconut Cream",
"F8F7FC" to "White Lilac",
"F8F8F7" to "Desert Storm",
"F8F99C" to "Texas",
"F8FACD" to "Corn Field",
"F8FDD3" to "Mimosa",
"F95A61" to "Carnation",
"F9BF58" to "Saffron Mango",
"F9E0ED" to "Carousel Pink",
"F9E4BC" to "Dairy Cream",
"F9E663" to "Portica",
"F9EAF3" to "Amour",
"F9F8E4" to "Rum Swizzle",
"F9FF8B" to "Dolly",
"F9FFF6" to "Sugar Cane",
"FA7814" to "Ecstasy",
"FA9D5A" to "Tan Hide",
"FAD3A2" to "Corvette",
"FADFAD" to "Peach Yellow",
"FAE600" to "Turbo",
"FAEAB9" to "Astra",
"FAECCC" to "Champagne",
"FAF0E6" to "Linen",
"FAF3F0" to "Fantasy",
"FAF7D6" to "Citrine White",
"FAFAFA" to "Alabaster",
"FAFDE4" to "Hint of Yellow",
"FAFFA4" to "Milan",
"FB607F" to "Brink Pink",
"FB8989" to "Geraldine",
"FBA0E3" to "Lavender Rose",
"FBA129" to "Sea Buckthorn",
"FBAC13" to "Sun",
"FBAED2" to "Lavender Pink",
"FBB2A3" to "Rose Bud",
"FBBEDA" to "Cupid",
"FBCCE7" to "Classic Rose",
"FBCEB1" to "Apricot Peach",
"FBE7B2" to "Banana Mania",
"FBE870" to "Marigold Yellow",
"FBE96C" to "Festival",
"FBEA8C" to "Sweet Corn",
"FBEC5D" to "Candy Corn",
"FBF9F9" to "Hint of Red",
"FBFFBA" to "Shalimar",
"FC0FC0" to "Shocking Pink",
"FC80A5" to "Tickle Me Pink",
"FC9C1D" to "Tree Poppy",
"FCC01E" to "Lightning Yellow",
"FCD667" to "Goldenrod",
"FCD917" to "Candlelight",
"FCDA98" to "Cherokee",
"FCF4D0" to "Double Pearl Lusta",
"FCF4DC" to "Pearl Lusta",
"FCF8F7" to "Vista White",
"FCFBF3" to "Bianca",
"FCFEDA" to "Moon Glow",
"FCFFE7" to "China Ivory",
"FCFFF9" to "Ceramic",
"FD0E35" to "Torch Red",
"FD5B78" to "Wild Watermelon",
"FD7B33" to "Crusta",
"FD7C07" to "Sorbus",
"FD9FA2" to "Sweet Pink",
"FDD5B1" to "Light Apricot",
"FDD7E4" to "Pig Pink",
"FDE1DC" to "Cinderella",
"FDE295" to "Golden Glow",
"FDE910" to "Lemon",
"FDF5E6" to "Old Lace",
"FDF6D3" to "Half Colonial White",
"FDF7AD" to "Drover",
"FDFEB8" to "Pale Prim",
"FDFFD5" to "Cumulus",
"FE28A2" to "Persian Rose",
"FE4C40" to "Sunset Orange",
"FE6F5E" to "Bittersweet",
"FE9D04" to "California",
"FEA904" to "Yellow Sea",
"FEBAAD" to "Melon",
"FED33C" to "Bright Sun",
"FED85D" to "Dandelion",
"FEDB8D" to "Salomie",
"FEE5AC" to "Cape Honey",
"FEEBF3" to "Remy",
"FEEFCE" to "Oasis",
"FEF0EC" to "Bridesmaid",
"FEF2C7" to "Beeswax",
"FEF3D8" to "Bleach White",
"FEF4CC" to "Pipi",
"FEF4DB" to "Half Spanish White",
"FEF4F8" to "Wisp Pink",
"FEF5F1" to "Provincial Pink",
"FEF7DE" to "Half Dutch White",
"FEF8E2" to "Solitaire",
"FEF8FF" to "White Pointer",
"FEF9E3" to "Off Yellow",
"FEFCED" to "Orange White",
"FF0000" to "Red",
"FF007F" to "Rose",
"FF00CC" to "Purple Pizzazz",
"FF00FF" to "Magenta Fuchsia",
"FF2400" to "Scarlet",
"FF3399" to "Wild Strawberry",
"FF33CC" to "Razzle Dazzle Rose",
"FF355E" to "Radical Red",
"FF3F34" to "Red Orange",
"FF4040" to "Coral Red",
"FF4D00" to "Vermilion",
"FF4F00" to "International Orange",
"FF6037" to "Outrageous Orange",
"FF6600" to "Blaze Orange",
"FF66FF" to "Pink Flamingo",
"FF681F" to "Orange",
"FF69B4" to "Hot Pink",
"FF6B53" to "Persimmon",
"FF6FFF" to "Blush Pink",
"FF7034" to "Burning Orange",
"FF7518" to "Pumpkin",
"FF7D07" to "Flamenco",
"FF7F00" to "Flush Orange",
"FF7F50" to "Coral",
"FF8C69" to "Salmon",
"FF9000" to "Pizazz",
"FF910F" to "West Side",
"FF91A4" to "Pink Salmon",
"FF9933" to "Neon Carrot",
"FF9966" to "Atomic Tangerine",
"FF9980" to "Vivid Tangerine",
"FF9E2C" to "Sunshade",
"FFA000" to "Orange Peel",
"FFA194" to "Mona Lisa",
"FFA500" to "Web Orange",
"FFA6C9" to "Carnation Pink",
"FFAB81" to "Hit Pink",
"FFAE42" to "Yellow Orange",
"FFB0AC" to "Cornflower Lilac",
"FFB1B3" to "Sundown",
"FFB31F" to "My Sin",
"FFB555" to "Texas Rose",
"FFB7D5" to "Cotton Candy",
"FFB97B" to "Macaroni and Cheese",
"FFBA00" to "Selective Yellow",
"FFBD5F" to "Koromiko",
"FFBF00" to "Amber",
"FFC0A8" to "Wax Flower",
"FFC0CB" to "Pink",
"FFC3C0" to "Your Pink",
"FFC901" to "Supernova",
"FFCBA4" to "Flesh",
"FFCC33" to "Sunglow",
"FFCC5C" to "Golden Tainoi",
"FFCC99" to "Peach Orange",
"FFCD8C" to "Chardonnay",
"FFD1DC" to "Pastel Pink",
"FFD2B7" to "Romantic",
"FFD38C" to "Grandis",
"FFD700" to "Gold",
"FFD800" to "School bus Yellow",
"FFD8D9" to "Cosmos",
"FFDB58" to "Mustard",
"FFDCD6" to "Peach Schnapps",
"FFDDAF" to "Caramel",
"FFDDCD" to "Tuft Bush",
"FFDDCF" to "Watusi",
"FFDDF4" to "Pink Lace",
"FFDEAD" to "Navajo White",
"FFDEB3" to "Frangipani",
"FFE1DF" to "Pippin",
"FFE1F2" to "Pale Rose",
"FFE2C5" to "Negroni",
"FFE5A0" to "Cream Brulee",
"FFE5B4" to "Peach",
"FFE6C7" to "Tequila",
"FFE772" to "Kournikova",
"FFEAC8" to "Sandy Beach",
"FFEAD4" to "Karry",
"FFEC13" to "Broom",
"FFEDBC" to "Colonial White",
"FFEED8" to "Derby",
"FFEFA1" to "Vis Vis",
"FFEFC1" to "Egg White",
"FFEFD5" to "Papaya Whip",
"FFEFEC" to "Fair Pink",
"FFF0DB" to "Peach Cream",
"FFF0F5" to "Lavender blush",
"FFF14F" to "Gorse",
"FFF1B5" to "Buttermilk",
"FFF1D8" to "Pink Lady",
"FFF1EE" to "Forget Me Not",
"FFF1F9" to "Tutu",
"FFF39D" to "Picasso",
"FFF3F1" to "Chardon",
"FFF46E" to "Paris Daisy",
"FFF4CE" to "Barley White",
"FFF4DD" to "Egg Sour",
"FFF4E0" to "Sazerac",
"FFF4E8" to "Serenade",
"FFF4F3" to "Chablis",
"FFF5EE" to "Seashell Peach",
"FFF5F3" to "Sauvignon",
"FFF6D4" to "Milk Punch",
"FFF6DF" to "Varden",
"FFF6F5" to "Rose White",
"FFF8D1" to "Baja White",
"FFF9E2" to "Gin Fizz",
"FFF9E6" to "Early Dawn",
"FFFACD" to "Lemon Chiffon",
"FFFAF4" to "Bridal Heath",
"FFFBDC" to "Scotch Mist",
"FFFBF9" to "Soapstone",
"FFFC99" to "Witch Haze",
"FFFCEA" to "Buttery White",
"FFFCEE" to "Island Spice",
"FFFDD0" to "Cream",
"FFFDE6" to "Chilean Heath",
"FFFDE8" to "Travertine",
"FFFDF3" to "Orchid White",
"FFFDF4" to "Quarter Pearl Lusta",
"FFFEE1" to "Half and Half",
"FFFEEC" to "Apricot White",
"FFFEF0" to "Rice Cake",
"FFFEF6" to "Black White",
"FFFEFD" to "Romance",
"FFFF00" to "Yellow",
"FFFF66" to "Laser Lemon",
"FFFF99" to "Pale Canary",
"FFFFB4" to "Portafino",
"FFFFF0" to "Ivory",
"FFFFFF" to "White")
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/MaterialColors.kt
================================================
package il.co.galex.namethatcolor.core.util
val colorsMaterialNames = mapOf(
"000000" to "black",
"FFFFFF" to "white",
"FFEBEE" to "red_50",
"FFCDD2" to "red_100",
"EF9A9A" to "red_200",
"E57373" to "red_300",
"EF5350" to "red_400",
"F44336" to "red_500",
"E53935" to "red_600",
"D32F2F" to "red_700",
"C62828" to "red_800",
"B71C1C" to "red_900",
"FF8A80" to "red_A100",
"FF5252" to "red_A200",
"FF1744" to "red_A400",
"D50000" to "red_A700",
"EDE7F6" to "deep_purple_50",
"D1C4E9" to "deep_purple_100",
"B39DDB" to "deep_purple_200",
"9575CD" to "deep_purple_300",
"7E57C2" to "deep_purple_400",
"673AB7" to "deep_purple_500",
"5E35B1" to "deep_purple_600",
"512DA8" to "deep_purple_700",
"4527A0" to "deep_purple_800",
"311B92" to "deep_purple_900",
"B388FF" to "deep_purple_A100",
"7C4DFF" to "deep_purple_A200",
"651FFF" to "deep_purple_A400",
"6200EA" to "deep_purple_A700",
"E1F5FE" to "light_blue_50",
"B3E5FC" to "light_blue_100",
"81D4FA" to "light_blue_200",
"4FC3F7" to "light_blue_300",
"29B6F6" to "light_blue_400",
"03A9F4" to "light_blue_500",
"039BE5" to "light_blue_600",
"0288D1" to "light_blue_700",
"0277BD" to "light_blue_800",
"01579B" to "light_blue_900",
"80D8FF" to "light_blue_A100",
"40C4FF" to "light_blue_A200",
"00B0FF" to "light_blue_A400",
"0091EA" to "light_blue_A700",
"E8F5E9" to "green_50",
"C8E6C9" to "green_100",
"A5D6A7" to "green_200",
"81C784" to "green_300",
"66BB6A" to "green_400",
"4CAF50" to "green_500",
"43A047" to "green_600",
"388E3C" to "green_700",
"2E7D32" to "green_800",
"1B5E20" to "green_900",
"B9F6CA" to "green_A100",
"69F0AE" to "green_A200",
"00E676" to "green_A400",
"00C853" to "green_A700",
"FFFDE7" to "yellow_50",
"FFF9C4" to "yellow_100",
"FFF59D" to "yellow_200",
"FFF176" to "yellow_300",
"FFEE58" to "yellow_400",
"FFEB3B" to "yellow_500",
"FDD835" to "yellow_600",
"FBC02D" to "yellow_700",
"F9A825" to "yellow_800",
"F57F17" to "yellow_900",
"FFFF8D" to "yellow_A100",
"FFFF00" to "yellow_A200",
"FFEA00" to "yellow_A400",
"FFD600" to "yellow_A700",
"FBE9E7" to "deep_orange_50",
"FFCCBC" to "deep_orange_100",
"FFAB91" to "deep_orange_200",
"FF8A65" to "deep_orange_300",
"FF7043" to "deep_orange_400",
"FF5722" to "deep_orange_500",
"F4511E" to "deep_orange_600",
"E64A19" to "deep_orange_700",
"D84315" to "deep_orange_800",
"BF360C" to "deep_orange_900",
"FF9E80" to "deep_orange_A100",
"FF6E40" to "deep_orange_A200",
"FF3D00" to "deep_orange_A400",
"DD2C00" to "deep_orange_A700",
"ECEFF1" to "blue_grey_50",
"CFD8DC" to "blue_grey_100",
"B0BEC5" to "blue_grey_200",
"90A4AE" to "blue_grey_300",
"78909C" to "blue_grey_400",
"607D8B" to "blue_grey_500",
"546E7A" to "blue_grey_600",
"455A64" to "blue_grey_700",
"37474F" to "blue_grey_800",
"263238" to "blue_grey_900",
"FCE4EC" to "pink_50",
"F8BBD0" to "pink_100",
"F48FB1" to "pink_200",
"F06292" to "pink_300",
"EC407A" to "pink_400",
"E91E63" to "pink_500",
"D81B60" to "pink_600",
"C2185B" to "pink_700",
"AD1457" to "pink_800",
"880E4F" to "pink_900",
"FF80AB" to "pink_A100",
"FF4081" to "pink_A200",
"F50057" to "pink_A400",
"C51162" to "pink_A700",
"E8EAF6" to "indigo_50",
"C5CAE9" to "indigo_100",
"9FA8DA" to "indigo_200",
"7986CB" to "indigo_300",
"5C6BC0" to "indigo_400",
"3F51B5" to "indigo_500",
"3949AB" to "indigo_600",
"303F9F" to "indigo_700",
"283593" to "indigo_800",
"1A237E" to "indigo_900",
"8C9EFF" to "indigo_A100",
"536DFE" to "indigo_A200",
"3D5AFE" to "indigo_A400",
"304FFE" to "indigo_A700",
"E0F7FA" to "cyan_50",
"B2EBF2" to "cyan_100",
"80DEEA" to "cyan_200",
"4DD0E1" to "cyan_300",
"26C6DA" to "cyan_400",
"00BCD4" to "cyan_500",
"00ACC1" to "cyan_600",
"0097A7" to "cyan_700",
"00838F" to "cyan_800",
"006064" to "cyan_900",
"84FFFF" to "cyan_A100",
"18FFFF" to "cyan_A200",
"00E5FF" to "cyan_A400",
"00B8D4" to "cyan_A700",
"F1F8E9" to "light_green_50",
"DCEDC8" to "light_green_100",
"C5E1A5" to "light_green_200",
"AED581" to "light_green_300",
"9CCC65" to "light_green_400",
"8BC34A" to "light_green_500",
"7CB342" to "light_green_600",
"689F38" to "light_green_700",
"558B2F" to "light_green_800",
"33691E" to "light_green_900",
"CCFF90" to "light_green_A100",
"B2FF59" to "light_green_A200",
"76FF03" to "light_green_A400",
"64DD17" to "light_green_A700",
"FFF8E1" to "amber_50",
"FFECB3" to "amber_100",
"FFE082" to "amber_200",
"FFD54F" to "amber_300",
"FFCA28" to "amber_400",
"FFC107" to "amber_500",
"FFB300" to "amber_600",
"FFA000" to "amber_700",
"FF8F00" to "amber_800",
"FF6F00" to "amber_900",
"FFE57F" to "amber_A100",
"FFD740" to "amber_A200",
"FFC400" to "amber_A400",
"FFAB00" to "amber_A700",
"EFEBE9" to "brown_50",
"D7CCC8" to "brown_100",
"BCAAA4" to "brown_200",
"A1887F" to "brown_300",
"8D6E63" to "brown_400",
"795548" to "brown_500",
"6D4C41" to "brown_600",
"5D4037" to "brown_700",
"4E342E" to "brown_800",
"3E2723" to "brown_900",
"F3E5F5" to "purple_50",
"E1BEE7" to "purple_100",
"CE93D8" to "purple_200",
"BA68C8" to "purple_300",
"AB47BC" to "purple_400",
"9C27B0" to "purple_500",
"8E24AA" to "purple_600",
"7B1FA2" to "purple_700",
"6A1B9A" to "purple_800",
"4A148C" to "purple_900",
"EA80FC" to "purple_A100",
"E040FB" to "purple_A200",
"D500F9" to "purple_A400",
"AA00FF" to "purple_A700",
"E3F2FD" to "blue_50",
"BBDEFB" to "blue_100",
"90CAF9" to "blue_200",
"64B5F6" to "blue_300",
"42A5F5" to "blue_400",
"2196F3" to "blue_500",
"1E88E5" to "blue_600",
"1976D2" to "blue_700",
"1565C0" to "blue_800",
"0D47A1" to "blue_900",
"82B1FF" to "blue_A100",
"448AFF" to "blue_A200",
"2979FF" to "blue_A400",
"2962FF" to "blue_A700",
"E0F2F1" to "teal_50",
"B2DFDB" to "teal_100",
"80CBC4" to "teal_200",
"4DB6AC" to "teal_300",
"26A69A" to "teal_400",
"009688" to "teal_500",
"00897B" to "teal_600",
"00796B" to "teal_700",
"00695C" to "teal_800",
"004D40" to "teal_900",
"A7FFEB" to "teal_A100",
"64FFDA" to "teal_A200",
"1DE9B6" to "teal_A400",
"00BFA5" to "teal_A700",
"F9FBE7" to "lime_50",
"F0F4C3" to "lime_100",
"E6EE9C" to "lime_200",
"DCE775" to "lime_300",
"D4E157" to "lime_400",
"CDDC39" to "lime_500",
"C0CA33" to "lime_600",
"AFB42B" to "lime_700",
"9E9D24" to "lime_800",
"827717" to "lime_900",
"F4FF81" to "lime_A100",
"EEFF41" to "lime_A200",
"C6FF00" to "lime_A400",
"AEEA00" to "lime_A700",
"FFF3E0" to "orange_50",
"FFE0B2" to "orange_100",
"FFCC80" to "orange_200",
"FFB74D" to "orange_300",
"FFA726" to "orange_400",
"FF9800" to "orange_500",
"FB8C00" to "orange_600",
"F57C00" to "orange_700",
"EF6C00" to "orange_800",
"E65100" to "orange_900",
"FFD180" to "orange_A100",
"FFAB40" to "orange_A200",
"FF9100" to "orange_A400",
"FF6D00" to "orange_A700",
"FAFAFA" to "grey_50",
"F5F5F5" to "grey_100",
"EEEEEE" to "grey_200",
"E0E0E0" to "grey_300",
"BDBDBD" to "grey_400",
"9E9E9E" to "grey_500",
"757575" to "grey_600",
"616161" to "grey_700",
"424242" to "grey_800",
"212121" to "grey_900"
)
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Rounding.kt
================================================
package il.co.galex.namethatcolor.core.util
import kotlin.math.roundToInt
fun Double.roundTo2Decimal() = (this * 100.0).roundToInt()
fun Double.roundTo2HexString() = "%02x".format((this).roundToInt())
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/annotator/ColorAnnotator.kt
================================================
package il.co.galex.namethatcolor.plugin.annotator
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.lang.annotation.Annotator
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.xml.XmlTextImpl
import il.co.galex.namethatcolor.core.manager.ColorNameFinder
import il.co.galex.namethatcolor.core.model.HexColor
import il.co.galex.namethatcolor.plugin.intention.NameColorIntention
import il.co.galex.namethatcolor.plugin.util.*
class ColorAnnotator : Annotator {
override fun annotate(element: PsiElement, holder: AnnotationHolder) {
try {
val color = HexColor(element.text)
// we found a value that is a valid color, checking that it is not already in a <color> tag
if ((element.parent as XmlTextImpl).parentTag?.name == RESOURCES_TAG_NAME) {
// color list from name that color
holder.newAnnotation(HighlightSeverity.ERROR, COLOR_ANNOTATION_MESSAGE)
.newFix(NameColorIntention(NAME_THAT_COLOR, color, ColorNameFinder::findColor))
.registerFix()
.create()
// material color palette
holder.newAnnotation(HighlightSeverity.ERROR, MATERIAL_COLOR_ANNOTATION_MESSAGE)
.newFix(NameColorIntention(NAME_THAT_MATERIAL_COLOR, color, ColorNameFinder::findMaterialColor))
.registerFix()
.create()
}
} catch (e: Exception) {
// found that a color is not valid for us, ignoring it
}
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/completion/CaretCompletionContributor.kt
================================================
package il.co.galex.namethatcolor.plugin.completion
import com.intellij.codeInsight.completion.*
import com.intellij.codeInsight.completion.CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED
import com.intellij.util.ProcessingContext
import il.co.galex.namethatcolor.core.manager.ColorNameFinder
import il.co.galex.namethatcolor.plugin.util.NAME_THAT_COLOR
import il.co.galex.namethatcolor.plugin.util.NAME_THAT_MATERIAL_COLOR
import il.co.galex.namethatcolor.plugin.util.PLACE
import il.co.galex.namethatcolor.plugin.util.addElement
/**
* Completes the color on the caret after the color was written
* (For some reason this shows up in the IDE only for lowercase entered colors)
*/
class CaretCompletionContributor : CompletionContributor() {
init {
extend(CompletionType.BASIC, PLACE, object : CompletionProvider<CompletionParameters>() {
override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, resultSet: CompletionResultSet) {
val text = parameters.position.text.replace(DUMMY_IDENTIFIER_TRIMMED, "")
resultSet.addElement(NAME_THAT_COLOR, text, ColorNameFinder::findColor)
resultSet.addElement(NAME_THAT_MATERIAL_COLOR, text, ColorNameFinder::findMaterialColor)
}
})
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/completion/ClipboardCompletionContributor.kt
================================================
package il.co.galex.namethatcolor.plugin.completion
import com.intellij.codeInsight.completion.*
import com.intellij.openapi.application.ex.ClipboardUtil
import com.intellij.util.ProcessingContext
import il.co.galex.namethatcolor.core.manager.ColorNameFinder
import il.co.galex.namethatcolor.plugin.util.NAME_THAT_COLOR
import il.co.galex.namethatcolor.plugin.util.NAME_THAT_MATERIAL_COLOR
import il.co.galex.namethatcolor.plugin.util.PLACE
import il.co.galex.namethatcolor.plugin.util.addElement
/**
* Completes the color from the clipboard
*/
class ClipboardCompletionContributor : CompletionContributor() {
init {
extend(CompletionType.BASIC, PLACE, object : CompletionProvider<CompletionParameters>() {
override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, resultSet: CompletionResultSet) {
ClipboardUtil.getTextInClipboard()?.let {
resultSet.addElement(NAME_THAT_COLOR, it, ColorNameFinder::findColor)
resultSet.addElement(NAME_THAT_MATERIAL_COLOR, it, ColorNameFinder::findMaterialColor)
}
}
})
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/intention/NameColorIntention.kt
================================================
package il.co.galex.namethatcolor.plugin.intention
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.lang.ASTFactory
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.XmlElementFactory
import com.intellij.psi.xml.XmlElementType
import com.intellij.psi.xml.XmlFile
import com.intellij.psi.xml.XmlText
import il.co.galex.namethatcolor.core.model.Color
import il.co.galex.namethatcolor.core.model.HexColor
import il.co.galex.namethatcolor.core.util.toXmlName
import il.co.galex.namethatcolor.plugin.util.xmlOutput
@Suppress("DialogTitleCapitalization")
class NameColorIntention(private val text: String, private val hexColor: HexColor, private val find: (color: HexColor) -> Pair<HexColor, Color>) : IntentionAction {
override fun getFamilyName(): String = "Name That Color"
override fun getText(): String = text
override fun startInWriteAction(): Boolean = true
override fun isAvailable(project: Project, editor: Editor?, file: PsiFile?): Boolean = true
override fun invoke(project: Project, editor: Editor?, file: PsiFile?) {
if (file is XmlFile) {
file.rootTag?.let { rootTag ->
val elements = rootTag.children.filterIsInstance<XmlText>()
elements.forEach { oldElement ->
if (oldElement.text.contains(hexColor.input)) {
val (hexColor, color) = find(HexColor(hexColor.input))
val name = color.name.toXmlName(hexColor.percentAlpha)
val insert = xmlOutput(name, hexColor.toString())
var newElement: PsiElement = XmlElementFactory.getInstance(project).createTagFromText(insert)
val split = oldElement.text.split(hexColor.input)
newElement = oldElement.replace(newElement)
// keep what was before and after the entered color
if (split.isNotEmpty()) rootTag.addBefore(insert(project, split[0]), newElement)
if (split.size > 1) rootTag.addAfter(insert(project, split[1]), newElement)
// get out of our loop if we found one to replace
return@forEach
}
}
}
}
}
private fun insert(project: Project, text: String): XmlText {
val tagFromText = XmlElementFactory.getInstance(project).createTagFromText("<a>$text</a>")
val textElements = tagFromText.value.textElements
return if (textElements.isEmpty()) ASTFactory.composite(XmlElementType.XML_TEXT) as XmlText else textElements[0]
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/CompletionResultSetExtensions.kt
================================================
package il.co.galex.namethatcolor.plugin.util
import com.intellij.codeInsight.completion.CompletionResultSet
import com.intellij.codeInsight.lookup.LookupElementBuilder
import il.co.galex.namethatcolor.core.exception.ColorNotFoundException
import il.co.galex.namethatcolor.core.model.Color
import il.co.galex.namethatcolor.core.model.HexColor
import il.co.galex.namethatcolor.core.util.toXmlName
inline fun CompletionResultSet.addElement(message: String, clipboard: String, find: (color: HexColor) -> Pair<HexColor, Color>) {
try {
val (hexColor, color) = find(HexColor(clipboard))
val name = color.name.toXmlName(hexColor.percentAlpha)
val insert = xmlOutput(name, hexColor.toString())
addElement(LookupElementBuilder.create(insert).withPresentableText(message))
} catch (e: ColorNotFoundException) {
println(e.localizedMessage)
} catch (e: IllegalArgumentException) {
println(e.localizedMessage)
}
}
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/Constants.kt
================================================
package il.co.galex.namethatcolor.plugin.util
import com.intellij.codeInsight.completion.CompletionUtilCore
import com.intellij.patterns.XmlPatterns
import com.intellij.psi.xml.XmlTag
import com.intellij.psi.xml.XmlToken
const val NAME_THAT_COLOR = "Name that color"
const val NAME_THAT_MATERIAL_COLOR = "Name that material color"
const val COLOR_ANNOTATION_MESSAGE = "Convert this automatically to an XML color tag named from a large set of colors"
const val MATERIAL_COLOR_ANNOTATION_MESSAGE = "Convert this automatically to an XML color tag named as a Material Color"
const val ALPHA_SEPARATOR = "_alpha_"
const val RESOURCES_TAG_NAME = "resources"
val PLACE = XmlPatterns.psiElement(XmlToken::class.java)
.withText(CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED)
.withParent(XmlPatterns.xmlText()
.withParent(XmlPatterns.psiElement(XmlTag::class.java)
.withName(RESOURCES_TAG_NAME)
)
)
================================================
FILE: namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/XmlOutput.kt
================================================
package il.co.galex.namethatcolor.plugin.util
fun xmlOutput(name: String, hexColor: String) = "<color name=\"$name\">$hexColor</color>"
================================================
FILE: namethatcolor/src/main/resources/META-INF/plugin.xml
================================================
<idea-plugin>
<id>il.co.galex.namethatcolor</id>
<name>Name That Color</name>
<version>1.7.1</version>
<vendor email="alexandre.gherschon@gmail.com" url="http://galex.co.il/namethatcolor">Alexander Gherschon</vendor>
<description><![CDATA[
Name the color you have in your clipboard directly inside your color resource file in Android Studio.<br>
Copy the color in your clipboard and go to your color resources files (usually colors.xml), then open the auto complete pop-up. You'll see there
two suggestions go generate the whole (material) color item, with the name of the (material swatch) color.
]]></description>
<change-notes><![CDATA[
<b>1.7.1</b><br>
- Updated plugin to latest IntelliJ version (2020.3)<br>
]]></change-notes>
<idea-version since-build="201.6668.113"/>
<depends optional="true" config-file="withKotlin.xml">org.jetbrains.kotlin</depends>
<extensions defaultExtensionNs="com.intellij">
<completion.contributor language="XML" implementationClass="il.co.galex.namethatcolor.plugin.completion.ClipboardCompletionContributor" />
<completion.contributor language="XML" implementationClass="il.co.galex.namethatcolor.plugin.completion.CaretCompletionContributor" />
<annotator language="XML" implementationClass="il.co.galex.namethatcolor.plugin.annotator.ColorAnnotator"/>
</extensions>
</idea-plugin>
================================================
FILE: namethatcolor/src/main/resources/META-INF/withKotlin.xml
================================================
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<annotator language="kotlin" implementationClass="com.example.MyKotlinAnnotator"/>
</extensions>
</idea-plugin>
================================================
FILE: namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/manager/ColorExtensionsTest.kt
================================================
package il.co.galex.namethatcolor.core.manager
import il.co.galex.namethatcolor.core.model.Hsl
import il.co.galex.namethatcolor.core.model.Rgb
import il.co.galex.namethatcolor.core.util.hsl
import il.co.galex.namethatcolor.core.util.rgb
import org.junit.Assert.assertEquals
import org.junit.Test
class ColorExtensionsTest {
@Test
fun `color to rgb`() {
// black
assertEquals(Rgb(0, 0, 0), "000000".rgb())
// white
assertEquals(Rgb(255, 255, 255), "FFFFFFF".rgb())
// red
assertEquals(Rgb(255, 0, 0), "FF0000".rgb())
// green
assertEquals(Rgb(0, 255, 0), "00FF00".rgb())
// blue
assertEquals(Rgb(0, 0, 255), "0000FF".rgb())
// random color with different values
assertEquals(Rgb(141, 144, 161), "8D90A1".rgb())
}
@Test
fun `color input to hsl`() {
// black
assertEquals(Hsl(0, 0, 0), "000000".hsl())
// white
assertEquals(Hsl(0, 0, 100), "FFFFFFF".hsl())
// random color with different values
assertEquals(Hsl(231, 10, 59), "8D90A1".hsl())
// some other random color with different values
assertEquals(Hsl(35, 88, 51), "f09414".hsl())
// some other random color with different values
assertEquals(Hsl(254, 46, 11), "150f29".hsl())
}
}
================================================
FILE: namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/manager/ColorNameFinderTest.kt
================================================
package il.co.galex.namethatcolor.core.manager
import il.co.galex.namethatcolor.core.model.HexColor
import org.junit.Assert.assertEquals
import org.junit.Test
class ColorNameFinderTest {
@Test
fun `find a color`() {
// black exact match
assertEquals("Black", ColorNameFinder.findColor(HexColor("#000000")).second.name)
// non exact match
assertEquals("Black Russian", ColorNameFinder.findColor(HexColor("#000010")).second.name)
// white exact match
assertEquals("White", ColorNameFinder.findColor(HexColor("#FFFFFF")).second.name)
// white with 3 letters only
assertEquals("White", ColorNameFinder.findColor(HexColor("#FFF")).second.name)
}
}
================================================
FILE: namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/model/HexColorTest.kt
================================================
package il.co.galex.namethatcolor.core.model
import il.co.galex.namethatcolor.core.util.toXmlName
import org.junit.Assert.assertEquals
import org.junit.Test
class HexColorTest {
@Test
fun `input color of 3 chars`() {
assertEquals("#3322DD", HexColor("32D").toString())
}
@Test
fun `input color of 3 chars with lowercase letters`() {
assertEquals("#3322DD", HexColor("32d").toString())
}
@Test
fun `input color of 3 chars with #`() {
assertEquals("#3322DD", HexColor("#32D").toString())
}
@Test
fun `input color of 3 chars with # and lowercase letters`() {
assertEquals("#DDDDDD", HexColor("#ddd").toString())
}
@Test
fun `input color of 3 chars with alpha`() {
assertEquals("#003322DD", HexColor("032D").toString())
}
@Test
fun `input color of 3 chars with alpha and #`() {
assertEquals("#AA3322DD", HexColor("#A32D").toString())
}
@Test
fun `input color of 6 chars`() {
assertEquals("#32DAE1", HexColor("32DAE1").toString())
}
@Test
fun `input color of 6 chars with #`() {
assertEquals("#123456", HexColor("#123456").toString())
}
@Test
fun `input color of 6 chars with alpha`() {
assertEquals("#A1B1C1D1", HexColor("A1B1C1D1").toString())
}
@Test
fun `input color of 6 chars with alpha and #`() {
assertEquals("#AA93214F", HexColor("#AA93214F").toString())
}
@Test
fun `alpha of 0 percent`() {
assertEquals(0, HexColor("#0931").percentAlpha)
}
@Test
fun `alpha of 0%`() {
assertEquals(0, HexColor("#0%931").percentAlpha)
assertEquals("#00993311", HexColor("#0%931").toString())
}
@Test
fun `alpha of 5 percent`() {
assertEquals(5, HexColor("#0D93214F").percentAlpha)
}
@Test
fun `alpha of 5%`() {
assertEquals(5, HexColor("#5%93214F").percentAlpha)
assertEquals("#0D93214F", HexColor("#5%93214F").toString())
}
@Test
fun `alpha of 25 percent`() {
assertEquals(25, HexColor("#4093214F").percentAlpha)
}
@Test
fun `alpha of 25%`() {
assertEquals(25, HexColor("#25%93214F").percentAlpha)
assertEquals("#4093214F", HexColor("#25%93214F").toString())
}
@Test
fun `alpha of 50 percent`() {
assertEquals(50, HexColor("#8093214F").percentAlpha)
}
@Test
fun `alpha of 50%`() {
assertEquals(50, HexColor("#50%93214F").percentAlpha)
assertEquals("#8093214F", HexColor("#50%93214F").toString())
}
@Test
fun `alpha of 75 percent`() {
assertEquals(75, HexColor("#BF93214F").percentAlpha)
}
@Test
fun `alpha of 75%`() {
assertEquals(75, HexColor("#75%93214F").percentAlpha)
assertEquals("#BF93214F", HexColor("#75%93214F").toString())
}
@Test
fun `alpha of 100 percent`() {
assertEquals(100, HexColor("#FF93214F").percentAlpha)
}
@Test
fun `alpha of 100%`() {
assertEquals(100, HexColor("#100%93214F").percentAlpha)
assertEquals("#FF93214F", HexColor("#100%93214F").toString())
}
@Test
fun `ignore default alpha value`() {
assertEquals("black", "black".toXmlName(HexColor("000000").percentAlpha))
assertEquals("black", "black".toXmlName(HexColor("%000000").percentAlpha))
assertEquals("black_alpha_100", "black".toXmlName(HexColor("100%000000").percentAlpha))
assertEquals("black_alpha_0", "black".toXmlName(HexColor("0%000000").percentAlpha))
assertEquals("black_alpha_10", "black".toXmlName(HexColor("10%000000").percentAlpha))
}
@Test(expected = IllegalArgumentException::class)
fun `invalid color input of 3 chars`() {
HexColor("#3ZD")
}
@Test(expected = IllegalArgumentException::class)
fun `invalid alpha input of 3 chars`() {
HexColor("P30D")
}
}
================================================
FILE: settings.gradle
================================================
include 'namethatcolor'
gitextract_a4_43eat/ ├── .gitignore ├── README.md ├── gradle/ │ └── wrapper/ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── namethatcolor/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ ├── kotlin/ │ │ │ └── il/ │ │ │ └── co/ │ │ │ └── galex/ │ │ │ └── namethatcolor/ │ │ │ ├── core/ │ │ │ │ ├── exception/ │ │ │ │ │ └── ColorNotFoundException.kt │ │ │ │ ├── manager/ │ │ │ │ │ └── ColorNameFinder.kt │ │ │ │ ├── model/ │ │ │ │ │ ├── Color.kt │ │ │ │ │ ├── HexColor.kt │ │ │ │ │ ├── Hsl.kt │ │ │ │ │ └── Rgb.kt │ │ │ │ └── util/ │ │ │ │ ├── ColorExtensions.kt │ │ │ │ ├── Colors.kt │ │ │ │ ├── MaterialColors.kt │ │ │ │ └── Rounding.kt │ │ │ └── plugin/ │ │ │ ├── annotator/ │ │ │ │ └── ColorAnnotator.kt │ │ │ ├── completion/ │ │ │ │ ├── CaretCompletionContributor.kt │ │ │ │ └── ClipboardCompletionContributor.kt │ │ │ ├── intention/ │ │ │ │ └── NameColorIntention.kt │ │ │ └── util/ │ │ │ ├── CompletionResultSetExtensions.kt │ │ │ ├── Constants.kt │ │ │ └── XmlOutput.kt │ │ └── resources/ │ │ └── META-INF/ │ │ ├── plugin.xml │ │ └── withKotlin.xml │ └── test/ │ └── kotlin/ │ └── il/ │ └── co/ │ └── galex/ │ └── namethatcolor/ │ └── core/ │ ├── manager/ │ │ ├── ColorExtensionsTest.kt │ │ └── ColorNameFinderTest.kt │ └── model/ │ └── HexColorTest.kt └── settings.gradle
Condensed preview — 29 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (111K chars).
[
{
"path": ".gitignore",
"chars": 46,
"preview": "out\n.idea\n*.iml\n*.jar\n.DS_Store\n.gradle\nbuild\n"
},
{
"path": "README.md",
"chars": 3889,
"preview": "# Name That Color - Android Studio Plugin\n\n## Introduction\n\nWhen I get a new color to set in my Android app, I never kno"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Fri Jan 04 09:52:12 IST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradlew",
"chars": 5296,
"preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n## Gradle start up"
},
{
"path": "gradlew.bat",
"chars": 2260,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
},
{
"path": "namethatcolor/build.gradle",
"chars": 444,
"preview": "buildscript {\n repositories {\n mavenCentral()\n jcenter()\n }\n}\n\nplugins {\n id \"org.jetbrains.intel"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/exception/ColorNotFoundException.kt",
"chars": 91,
"preview": "package il.co.galex.namethatcolor.core.exception\n\nclass ColorNotFoundException: Exception()"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/manager/ColorNameFinder.kt",
"chars": 2318,
"preview": "package il.co.galex.namethatcolor.core.manager\n\nimport il.co.galex.namethatcolor.core.exception.ColorNotFoundException\ni"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Color.kt",
"chars": 129,
"preview": "package il.co.galex.namethatcolor.core.model\n\ndata class Color(val hexCode: String, val name: String, val rgb: Rgb, val "
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/HexColor.kt",
"chars": 2957,
"preview": "package il.co.galex.namethatcolor.core.model\n\nimport il.co.galex.namethatcolor.core.util.hsl\nimport il.co.galex.namethat"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Hsl.kt",
"chars": 96,
"preview": "package il.co.galex.namethatcolor.core.model\n\ndata class Hsl(val h: Int, val s: Int, val l: Int)"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/model/Rgb.kt",
"chars": 193,
"preview": "package il.co.galex.namethatcolor.core.model\n\ndata class Rgb(val r: Int, val g: Int, val b: Int) {\n\n fun percent(): T"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/ColorExtensions.kt",
"chars": 1870,
"preview": "package il.co.galex.namethatcolor.core.util\n\nimport il.co.galex.namethatcolor.core.model.Hsl\nimport il.co.galex.namethat"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Colors.kt",
"chars": 51706,
"preview": "package il.co.galex.namethatcolor.core.util\n\nimport il.co.galex.namethatcolor.core.model.Color\n\n/**\n * List of colors\n *"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/MaterialColors.kt",
"chars": 8873,
"preview": "package il.co.galex.namethatcolor.core.util\n\nval colorsMaterialNames = mapOf(\n \"000000\" to \"black\",\n \"FFFF"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/core/util/Rounding.kt",
"chars": 202,
"preview": "package il.co.galex.namethatcolor.core.util\n\nimport kotlin.math.roundToInt\n\nfun Double.roundTo2Decimal() = (this * 100.0"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/annotator/ColorAnnotator.kt",
"chars": 1672,
"preview": "package il.co.galex.namethatcolor.plugin.annotator\n\nimport com.intellij.lang.annotation.AnnotationHolder\nimport com.inte"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/completion/CaretCompletionContributor.kt",
"chars": 1307,
"preview": "package il.co.galex.namethatcolor.plugin.completion\n\nimport com.intellij.codeInsight.completion.*\nimport com.intellij.co"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/completion/ClipboardCompletionContributor.kt",
"chars": 1169,
"preview": "package il.co.galex.namethatcolor.plugin.completion\n\nimport com.intellij.codeInsight.completion.*\nimport com.intellij.op"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/intention/NameColorIntention.kt",
"chars": 2783,
"preview": "package il.co.galex.namethatcolor.plugin.intention\n\nimport com.intellij.codeInsight.intention.IntentionAction\nimport com"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/CompletionResultSetExtensions.kt",
"chars": 969,
"preview": "package il.co.galex.namethatcolor.plugin.util\n\nimport com.intellij.codeInsight.completion.CompletionResultSet\nimport com"
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/Constants.kt",
"chars": 972,
"preview": "package il.co.galex.namethatcolor.plugin.util\n\nimport com.intellij.codeInsight.completion.CompletionUtilCore\nimport com."
},
{
"path": "namethatcolor/src/main/kotlin/il/co/galex/namethatcolor/plugin/util/XmlOutput.kt",
"chars": 136,
"preview": "package il.co.galex.namethatcolor.plugin.util\n\nfun xmlOutput(name: String, hexColor: String) = \"<color name=\\\"$name\\\">$h"
},
{
"path": "namethatcolor/src/main/resources/META-INF/plugin.xml",
"chars": 1423,
"preview": "<idea-plugin>\n <id>il.co.galex.namethatcolor</id>\n <name>Name That Color</name>\n <version>1.7.1</version>\n <"
},
{
"path": "namethatcolor/src/main/resources/META-INF/withKotlin.xml",
"chars": 188,
"preview": "<idea-plugin>\n <extensions defaultExtensionNs=\"com.intellij\">\n <annotator language=\"kotlin\" implementationClas"
},
{
"path": "namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/manager/ColorExtensionsTest.kt",
"chars": 1338,
"preview": "package il.co.galex.namethatcolor.core.manager\n\nimport il.co.galex.namethatcolor.core.model.Hsl\nimport il.co.galex.namet"
},
{
"path": "namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/manager/ColorNameFinderTest.kt",
"chars": 722,
"preview": "package il.co.galex.namethatcolor.core.manager\n\nimport il.co.galex.namethatcolor.core.model.HexColor\nimport org.junit.As"
},
{
"path": "namethatcolor/src/test/kotlin/il/co/galex/namethatcolor/core/model/HexColorTest.kt",
"chars": 3947,
"preview": "package il.co.galex.namethatcolor.core.model\n\nimport il.co.galex.namethatcolor.core.util.toXmlName\nimport org.junit.Asse"
},
{
"path": "settings.gradle",
"chars": 23,
"preview": "include 'namethatcolor'"
}
]
About this extraction
This page contains the full source code of the galex/name-that-color-intellij-plugin GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 29 files (95.0 KB), approximately 34.0k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.