git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2094 first pass with jalview.api.ColorI interface
[jalview.git]
/
src
/
jalview
/
util
/
ColorUtils.java
diff --git
a/src/jalview/util/ColorUtils.java
b/src/jalview/util/ColorUtils.java
index
31d1ded
..
4ba17d5
100644
(file)
--- a/
src/jalview/util/ColorUtils.java
+++ b/
src/jalview/util/ColorUtils.java
@@
-24,12
+24,18
@@
package jalview.util;
package jalview.util;
+import jalview.api.ColorI;
+
import java.awt.Color;
import java.util.Random;
public class ColorUtils
{
import java.awt.Color;
import java.util.Random;
public class ColorUtils
{
+ public static Color getColor(ColorI c)
+ {
+ return new Color(c.getRed(), c.getGreen(), c.getBlue());
+ }
/**
* Generates a random color, will mix with input color. Code taken from
* http://stackoverflow
/**
* Generates a random color, will mix with input color. Code taken from
* http://stackoverflow
@@
-68,7
+74,7
@@
public class ColorUtils
* ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/colortool.html#
* tkcode
*/
* ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/colortool.html#
* tkcode
*/
- public static final String toTkCode(Color colour)
+ public static final String toTkCode(ColorI colour)
{
String colstring = "#" + ((colour.getRed() < 16) ? "0" : "")
+ Integer.toHexString(colour.getRed())
{
String colstring = "#" + ((colour.getRed() < 16) ? "0" : "")
+ Integer.toHexString(colour.getRed())