It's pointless to use 2 different kinds of coloring syntax. The default color is #000000, as defined by the exception when choosing how to display the output. Java's library makes it easy to convert to and from hex, so utilize that.
Discussion
Anonymous
-
2009-02-05
I think you need to check the length of the string, you cannot assume toHexString() will always provide 2 characters for the alpha. It doesn't add leading zeros.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-02-05
Can you explain what you meant by "the exception when choosing how to display the output"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Explanation of what I meant: Look at the catch branch of the try/catch in parseHighlightStyle. The current code is
style = "color:#000000"
Which is in hex style color. The thinking is exactly the same, so stick with one or the other. Suggest using the more widely used and standard-in-the-web-world method since this is supposedly HTML/CSS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-02-06
I'm sorry, the two are not related. The one that shows in the exception is a syntax style used internally by jEdit for the text area syntax token styles, and that string is parsed internally by jEdit. This is completely different from the string representation of styles in html, which is used in the hypersearch results and parsed by Swing. It just happens to be similar for colors, but it's completely different in other things.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-02-06
status: open --> closed-rejected
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you need to check the length of the string, you cannot assume toHexString() will always provide 2 characters for the alpha. It doesn't add leading zeros.
Can you explain what you meant by "the exception when choosing how to display the output"?
convert to hex internally, round 2
Good catch on the leading zeros not added. Try the round 2 patch on for size.
Explanation of what I meant: Look at the catch branch of the try/catch in parseHighlightStyle. The current code is
style = "color:#000000"
Which is in hex style color. The thinking is exactly the same, so stick with one or the other. Suggest using the more widely used and standard-in-the-web-world method since this is supposedly HTML/CSS.
I'm sorry, the two are not related. The one that shows in the exception is a syntax style used internally by jEdit for the text area syntax token styles, and that string is parsed internally by jEdit. This is completely different from the string representation of styles in html, which is used in the hypersearch results and parsed by Swing. It just happens to be similar for colors, but it's completely different in other things.