Menu

#226 Use standard HTML hex color style

closed-rejected
nobody
5
2009-02-06
2009-02-05
No

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

    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.

     
  • Anonymous

    Anonymous - 2009-02-05

    Can you explain what you meant by "the exception when choosing how to display the output"?

     
  • Kevin Hunter Kesling

    convert to hex internally, round 2

     
  • Kevin Hunter Kesling

    Good catch on the leading zeros not added. Try the round 2 patch on for size.

     
  • Kevin Hunter Kesling

    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.

     
  • Anonymous

    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.

     
  • Anonymous

    Anonymous - 2009-02-06
    • status: open --> closed-rejected
     

Log in to post a comment.

MongoDB Logo MongoDB