Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ideas:color-object [2014/07/07 18:32] – fix return values tabatkinsideas:color-object [2014/07/09 09:54] – Lingering ref to "CSSColor" tabatkins
Line 15: Line 15:
     static RGBAColor fromHex(optional HexColorInit color);     static RGBAColor fromHex(optional HexColorInit color);
          
-    stringifier DOMString (optional DOMString type="rgba");+    DOMString toString(optional DOMString type="rgba");
     static readonly attribute Map serializationTypes;     static readonly attribute Map serializationTypes;
   };   };
  
-The stringifier looks up the type in the RGBAColor.serializationTypes Map; if it finds a function, it calls that with the RGBAColor as the sole argument and returns whatever the function returns.  It's preloaded with UA-defined functions for "hex3", "hex6", "rgb", "rgba", "hsl", and "hsla"+The toString() method looks up the type in the RGBAColor.serializationTypes Map; if it finds a function, it calls that with the RGBAColor as the sole argument and returns whatever the function returns.  It's preloaded with UA-defined functions for "hex3", "hex6", "rgb", "rgba", "hsl", and "hsla"
  
 Authors can define their own color formats by adding a fromFoo() to RGBAColor, a toFoo() to RGBAColor.prototype, and adding an appropriate serialization tag to RGBAColor.serializationTypes. Authors can define their own color formats by adding a fromFoo() to RGBAColor, a toFoo() to RGBAColor.prototype, and adding an appropriate serialization tag to RGBAColor.serializationTypes.
Line 45: Line 45:
      
   partial interface CSS {   partial interface CSS {
-    CSSColor parseColor(DOMString color, optional Element el);+    RGBAColor parseColor(DOMString color, optional Element el);
   };   };
  
 
ideas/color-object.txt · Last modified: 2021/10/01 15:36 by fantasai
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki