Griffon
  1. Griffon
  2. GRIFFON-134

CSSBuilder: background-color property doesn't work with HEX values

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: builders
    • Labels:
      None
    • Environment:
      Windows Vista Business, Service Pack 2
    • Number of attachments :
      0

      Description

      From Gr8 Forums: http://gr8forums.org/viewtopic.php?f=19&t=124

      Today I was giving a try to the CSSBuilder plugin 0.3 and I found that If I create the following stylesheet:

      griffon-app/resources/styles.css
      * {
         background-color: #999999;
      }
      

      and I use it like this:

      griffon-app/lifecycle/Startup.groovy
      ...
      import griffon.builder.css.CSSDecorator
      ...
      CSSDecorator.decorate("styles",app.appFrames[0])
      ...
      

      when I run my griffon application I get the following exception:

      ...
      22-dic-2009 19:50:12 com.feature50.clarity.css.CSSUtils getColor
      ADVERTENCIA: background-color value ('rgb(153, 153, 153)') not understood
      java.lang.NumberFormatException: For input string: " 153"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
              at java.lang.Integer.parseInt(Integer.java:449)
              at java.lang.Integer.parseInt(Integer.java:499)
              at com.feature50.clarity.css.CSSUtils.getColor(CSSUtils.java:132)
              at com.feature50.clarity.css.DefaultCSSPropertyHandler.processStyles(DefaultCSSPropertyHandler.java:154)
              at com.feature50.clarity.css.CSSPropertyHandlers.handle(CSSPropertyHandlers.java:40)
              at griffon.builder.css.CSSDecorator.applyStylesheet(CSSDecorator.java:160)
              at griffon.builder.css.CSSDecorator.decorate(CSSDecorator.java:132)
              at griffon.builder.css.CSSDecorator.decorate(CSSDecorator.java:76)
              at griffon.builder.css.CSSDecorator$decorate.call(Unknown Source)
              at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:129)
              at Startup.run(Startup.groovy:20)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
              at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1049)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:917)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:880)
              at groovy.lang.Closure.call(Closure.java:279)
              at groovy.lang.Closure.call(Closure.java:274)
              at groovy.lang.Closure.run(Closure.java:355)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      

      In the documentation it says that you can express the backgroud-color property value as a CSSColor2 name or a Hex value starting with #

      Thanks.

        Activity

        Hide
        Andres Almiray added a comment -

        Fixed in CSSBuilder 0.4 and css-builder plugin 0.4

        Show
        Andres Almiray added a comment - Fixed in CSSBuilder 0.4 and css-builder plugin 0.4

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Jorge Muñiz Morán
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: