SOURCE CODE: Uize.Widgets.Buttons.ColorSwatch.Html (view docs)

Uize.module ({
  name:'Uize.Widgets.Buttons.ColorSwatch.Html',
  builder:function () {
    'use strict';

    return Uize.package ({
      process:function (i) {
        function _cssClass (_class) {return m.cssClass (_class)}
        function _resolveNonStringToPixel (_value) {return typeof _value == "string" ? _value : +_value + "px"}
        var
          m = this,
          i = arguments [0],
          _idPrefix = i.idPrefix,
          _fragment0 = '" class="'
        ;
        return (
          '<div id="' + _idPrefix + _fragment0 + i['mCssBindings_rootNodeClasses'] + '"><div id="' + _idPrefix + '-swatch' + _fragment0 + _cssClass ('swatch') + '" style="' + 'background-color:' + _resolveNonStringToPixel (i['valueAsRgbHex']) + ';' + '"></div></div>'
        );

      }
    });
  }
});