stanch / reftree

Automatically generated diagrams and animations for Scala data structures
http://stanch.github.io/reftree/
GNU General Public License v3.0
587 stars 36 forks source link

Color.fromRgbaString does not accept uppercase Hex Chars #13

Closed Empty2k12 closed 7 years ago

Empty2k12 commented 7 years ago

Color.fromRgbaString( "#F44336" )

yields the following error:

[error] (run-main-18) java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
    at com.liefery.courier_android_app.reftree.Render.main(Render.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
Caused by: fastparse.core.ParseError: found "#F44336", expected transparent | white | rgba at index 0
#F44336
^
    at fastparse.core.Parsed$class.get(Parsing.scala:32)
    at fastparse.core.Parsed$Failure.get(Parsing.scala:74)
    at reftree.geometry.Color$.fromRgbaString(Color.scala:95)
    at com.liefery.courier_android_app.reftree.Render$.<init>(Render.scala:18)
    at com.liefery.courier_android_app.reftree.Render$.<clinit>(Render.scala:12)
    at com.liefery.courier_android_app.reftree.Render.main(Render.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

Changing the color hex to lower case fixes the error.

The line which is causing this is val x = CharIn(('0' to '9') ++ ('a' to 'f')) here

stanch commented 7 years ago

Just published 1.1.2 with the fix.

Empty2k12 commented 7 years ago

Thank you!