randomColor() public static method

Returns a random CSS color.
public static randomColor ( ) : string
return string A random CSS color string.
Ejemplo n.º 1
0
 /**
  * Create the default calendar share for the current user.
  *
  * @return Horde_Share_Object The new default share.
  */
 public function createDefaultShare()
 {
     $share = $this->_shares->newShare($this->_user, strval(new Horde_Support_Randomid()), $this->_getDefaultShareName());
     $share->set('color', Kronolith::randomColor());
     $this->_prepareDefaultShare($share);
     $this->_shares->addShare($share);
     return $share;
 }
Ejemplo n.º 2
0
 public function __construct($vars)
 {
     parent::__construct($vars, _("Create Calendar"));
     $this->addVariable(_("Name"), 'name', 'text', true);
     $v = $this->addVariable(_("Color"), 'color', 'colorpicker', false);
     $v->setDefault(Kronolith::randomColor());
     if ($GLOBALS['registry']->isAdmin()) {
         $this->addVariable(_("System Calendar"), 'system', 'boolean', false, false, _("System calendars don't have an owner. Only administrators can change the calendar settings and permissions."));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     $this->addVariable(_("Tags"), 'tags', 'kronolith:KronolithTags', false);
     $this->setButtons(array(_("Create")));
 }