Esempio n. 1
0
 public function makePalette(Color $color)
 {
     list($red, $green, $blue) = $color->asArray();
     $light = "rgba({$red},{$green},{$blue},0.1)";
     $full = "rgba({$red},{$green},{$blue},1)";
     return ['fillColor' => $light, 'strokeColor' => $full, 'pointColor' => $full, 'pointStrokeColor' => "#fff", 'pointHighlightFill' => "#fff", 'pointHighlightStroke' => $full];
 }
Esempio n. 2
0
 /**
  * @param Color $value
  * @return mixed
  */
 public function render($value)
 {
     if (!$value) {
         return null;
     }
     return (string) new Element('span', ['style' => 'padding: 2pt 6pt; background-color: ' . $value->asHex()], [$value->asHex()]);
 }
Esempio n. 3
0
 /**
  * @return Color
  */
 public function next()
 {
     if (!$this->colors) {
         return Color::RANDOM();
     }
     return array_shift($this->colors);
 }
Esempio n. 4
0
 private function getRatingScatterData()
 {
     $data = [new ScatterDataSet([new ScatterDataPoint(0, 0, 0.1), new ScatterDataPoint(10, 10, 0.1)], '', Color::fromHex('#ffffff'))];
     foreach ($this->goals as $goalId => $goal) {
         if (isset($this->achievedGoals[$goalId]) || isset($this->cancelledGoals[$goalId])) {
             continue;
         } else {
             if (isset($this->ratings[$goalId])) {
                 $rating = $this->ratings[$goalId];
             } else {
                 $rating = new Rating(0, 0);
             }
         }
         $incompleteTasks = $this->getIncompleteTasks($goalId);
         if ($incompleteTasks) {
             if (!$this->getNextBrick($goalId)) {
                 $color = Color::PURPLE();
             } else {
                 $color = Color::GREEN();
             }
             $size = min(3, 0.5 + count($incompleteTasks) / 4);
         } else {
             $color = Color::RED();
             $size = 2;
         }
         $data[] = new ScatterDataSet([new ScatterDataPoint($rating->getUrgency(), $rating->getImportance(), $size)], $this->goals[$goalId]['name'], $color);
     }
     return $data;
 }
Esempio n. 5
0
 public function makePalette(Color $color)
 {
     list($red, $green, $blue) = $color->asArray();
     return ['color' => "rgba({$red},{$green},{$blue},1)", 'highlight' => "rgba({$red},{$green},{$blue},0.8)"];
 }
Esempio n. 6
0
 public function getScatterChart()
 {
     return new ScatterChart([new ScatterDataSet([new ScatterDataPoint(12, 42, 2), new ScatterDataPoint(4, 3, 6), new ScatterDataPoint(16, 2, 4), new ScatterDataPoint(4, 42)], 'foo', Color::PINK()), new ScatterDataSet([new ScatterDataPoint(4, 23, 8), new ScatterDataPoint(14, 30, 7), new ScatterDataPoint(6, 22, 2), new ScatterDataPoint(3, 2)], 'bar', Color::ORANGE())]);
 }
Esempio n. 7
0
 /**
  * @param Parameter $parameter
  * @param Color $value
  * @return string
  */
 public function render(Parameter $parameter, $value)
 {
     return (string) new Element('input', array_merge(['type' => 'color', 'name' => $parameter->getName(), 'value' => $value ? $value->asHex() : ''], $parameter->isRequired() ? ['required' => 'required'] : []));
 }
Esempio n. 8
0
 public function makePalette(Color $color)
 {
     list($red, $green, $blue) = $color->asArray();
     return ['strokeColor' => "rgba({$red},{$green},{$blue},1)", 'pointColor' => "rgba({$red},{$green},{$blue},1)", 'pointStrokeColor' => "rgba({$red},{$green},{$blue},0.8)"];
 }