Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-20 05:15:20 -0500
committerTom Schindl2014-01-20 05:15:20 -0500
commit40da8f8df50036ab8614b2e0eb6f561a6e886909 (patch)
tree2df82c999b10be3e846afa0e03b9090c21432258
parentff419a74c4be492f3cc461d8d841989416a48460 (diff)
downloadorg.eclipse.efxclipse-40da8f8df50036ab8614b2e0eb6f561a6e886909.tar.gz
org.eclipse.efxclipse-40da8f8df50036ab8614b2e0eb6f561a6e886909.tar.xz
org.eclipse.efxclipse-40da8f8df50036ab8614b2e0eb6f561a6e886909.zip
fixed javadoc
-rwxr-xr-xbundles/runtime/org.eclipse.fx.formats.svg/src/org/eclipse/fx/formats/svg/converter/Colors.java108
1 files changed, 82 insertions, 26 deletions
diff --git a/bundles/runtime/org.eclipse.fx.formats.svg/src/org/eclipse/fx/formats/svg/converter/Colors.java b/bundles/runtime/org.eclipse.fx.formats.svg/src/org/eclipse/fx/formats/svg/converter/Colors.java
index 31e3f12b4..57be11b44 100755
--- a/bundles/runtime/org.eclipse.fx.formats.svg/src/org/eclipse/fx/formats/svg/converter/Colors.java
+++ b/bundles/runtime/org.eclipse.fx.formats.svg/src/org/eclipse/fx/formats/svg/converter/Colors.java
@@ -10,55 +10,111 @@
*******************************************************************************/
package org.eclipse.fx.formats.svg.converter;
+/**
+ * Colors
+ */
public enum Colors {
- WHITE("#ffffff"),
- BLACK("#000000");
-
+ /**
+ * white
+ */
+ WHITE("#ffffff"), //$NON-NLS-1$
+ /**
+ * black
+ */
+ BLACK("#000000"); //$NON-NLS-1$
+
+ /**
+ * the hex value
+ */
public final String hexvalue;
+ /**
+ * rgb red
+ */
public final double red;
+ /**
+ * rgb green
+ */
public final double green;
+ /**
+ * rgb blue
+ */
public final double blue;
-
+
private Colors(String hex) {
- hexvalue = hex;
- red = hexRed(hex);
- green = hexGreen(hex);
- blue = hexBlue(hex);
+ this.hexvalue = hex;
+ this.red = hexRed(hex);
+ this.green = hexGreen(hex);
+ this.blue = hexBlue(hex);
}
-
+
+ /**
+ * Red part of the hex
+ *
+ * @param color
+ * the color
+ * @return the value
+ */
public static double hexRed(String color) {
- if( color.length() == 4 ) {
- return Integer.valueOf(color.substring(1,2) + color.substring(1,2),16) / 255.0;
+ if (color.length() == 4) {
+ return Integer.parseInt(color.substring(1, 2) + color.substring(1, 2), 16) / 255.0;
}
- return Integer.valueOf(color.substring(1,3),16) / 255.0;
+ return Integer.parseInt(color.substring(1, 3), 16) / 255.0;
}
-
+
+ /**
+ * Green part of the hex
+ *
+ * @param color
+ * the color
+ * @return the value
+ */
public static double hexGreen(String color) {
- if( color.length() == 4 ) {
- return Integer.valueOf(color.substring(2,3) + color.substring(2,3),16) / 255.0;
+ if (color.length() == 4) {
+ return Integer.parseInt(color.substring(2, 3) + color.substring(2, 3), 16) / 255.0;
}
- return Integer.valueOf(color.substring(3,5),16) / 255.0;
+ return Integer.parseInt(color.substring(3, 5), 16) / 255.0;
}
-
+
+ /**
+ * Blue part of the hex
+ *
+ * @param color
+ * the color
+ * @return the value
+ */
public static double hexBlue(String color) {
- if( color.length() == 4 ) {
- return Integer.valueOf(color.substring(3,4) + color.substring(3,4),16) / 255.0;
+ if (color.length() == 4) {
+ return Integer.parseInt(color.substring(3, 4) + color.substring(3, 4), 16) / 255.0;
}
- return Integer.valueOf(color.substring(5,7),16) / 255.0;
+ return Integer.parseInt(color.substring(5, 7), 16) / 255.0;
}
-
+
+ /**
+ * Find the color by the hex value
+ *
+ * @param hex
+ * the hex value
+ * @return the color
+ */
public static Colors findColorByHex(String hex) {
- for( Colors c : values() ) {
- if( c.hexvalue.equals(hex) ) {
+ for (Colors c : values()) {
+ if (c.hexvalue.equals(hex)) {
return c;
}
}
return null;
}
-
+
+ /**
+ * Find the color by name
+ *
+ * @param name
+ * the name
+ * @return the color
+ */
public static Colors findColorByName(String name) {
- for( Colors c : values() ) {
- if( c.name().toUpperCase().equals(name.toUpperCase()) ) {
+ for (Colors c : values()) {
+ if (c.name().toUpperCase().equals(name.toUpperCase())) {
return c;
}
}

Back to the top