CORE/core/view.php : 237 CORE/core/view.php : 196 CORE/core/controller.php : 120 APP/controller/tools/source.php : 75 CORE/core/controller.php : 89 CORE/core/controller.php : 70 CORE/core.php : 170 BASE/index.php : 9 0.00248 - Loading view "view/page/source.html" CORE/core/view.php : 237 CORE/core/view.php : 196 CORE/core/controller.php : 120 APP/controller/index.php : 65 APP/controller/tools/source.php : 75 CORE/core/controller.php : 89 CORE/core/controller.php : 70 CORE/core.php : 170 BASE/index.php : 9 0.00279 - Loading view "view/page.html" UltraLight Showcase

Source for controller:color

<?php

namespace App\Controller;

/**
 * Color class example page.
 */
class Color extends Index
{
    const 
STEP_SIZE 0.02;

    protected function 
_run()
    {
        
$gamma \Request::value('gamma'\Core\Format\Color::GAMMA);
        
$data = [
            
'gamma' => $gamma,
            
'gradient1' => $this->drawColorFade(['ff0000''0000ff''00ff00''ff0000'], $gamma),
            
'gradient2' => $this->drawColorFade(['ffff00''00ffff''ff00ff''ffff00'], $gamma),
            
'gradient3' => $this->drawColorFade(['ffffff''000000''99ccff''ff99cc'], $gamma),
            
'brightness1' => $this->drawBrightness('00FF00'$gamma),
            
'brightness2' => $this->drawBrightness('99ccff'$gamma),
            
'brightness3' => $this->drawBrightness('000000'$gamma),
        ];
        return 
$this->_output('Color fades'$this->_show('page/color'$data));
    }

    
/**
     * Draw color-fade, fading normally through all steps.
     * @param array $blocks
     * @param float $gamma
     */
    
private function drawColorFade($blocks$gamma)
    {
        
$previousBlock array_shift($blocks);
        
$colors = [];
        foreach (
$blocks as $block) {
            
$from = new \Core\Format\Color($previousBlock$gamma);
            
$to = new \Core\Format\Color($block$gamma);
            for (
$i 0$i <= 1$i += self::STEP_SIZE) {
                
$colors[] = $from->fadeTo($to$i);
            }
            
$previousBlock $block;
        }
        return 
$this->_drawColors($colors);
    }

    
/**
     * Draw color-fade, fading normally through all steps.
     * @param array $blocks
     * @param float $gamma
     */
    
private function drawBrightness($color$gamma)
    {
        
$colors = [];
        
$color = new \Core\Format\Color($color$gamma);
        
$stepsize self::STEP_SIZE 2;
        for (
$i 0$i <= 1$i += $stepsize) {
            
$colors[] = $color->setBrightness($i);
        }
        return 
$this->_drawColors($colors);
    }

    
/**
     * Draw colors for testing.
     * @param type $colors
     * @return type
     */
    
private function _drawColors($colors)
    {
        
$result = [];
        foreach (
$colors as $color) {
            
$result[] = "<div style=\"background: {$color}; overflow: hidden; height: 4px; \">&nbsp;</div>";
        }
        return 
implode(PHP_EOL$result);
    }
}
CORE/core.php : 185 BASE/index.php : 9 0.00326 - Loaded classes array (14) ( 'Show' => array (2) ( 'file' => "CORE/show.php", 'time' => 0.00019, ), 'Config' => array (2) ( 'file' => "CORE/config.php", 'time' => 0.00022, ), 'Core\Cache' => array (2) ( 'file' => "CORE/core/cache.php", 'time' => 0.00026, ), 'Core\Cache\File' => array (2) ( 'file' => "CORE/core/cache/file.php", 'time' => 0.00026, ), 'Core\Arrays' => array (2) ( 'file' => "CORE/core/arrays.php", 'time' => 0.00047, ), 'Request' => array (2) ( 'file' => "CORE/request.php", 'time' => 0.00068, ), 'Sanitize' => array (2) ( 'file' => "CORE/sanitize.php", 'time' => 0.0007, ), 'Core\Controller' => array (2) ( 'file' => "CORE/core/controller.php", 'time' => 0.00076, ), 'App\Controller\Index' => array (2) ( 'file' => "APP/controller/index.php", 'time' => 0.00076, ), '\App\Controller\Tools\Source' => array (2) ( 'file' => "APP/controller/tools/source.php", 'time' => 0.00076, ), 'Core\View' => array (2) ( 'file' => "CORE/core/view.php", 'time' => 0.00079, ), 'App\Library\Sourcelist' => array (2) ( 'file' => "APP/library/sourcelist.php", 'time' => 0.00187, ), 'Core\Format\Variable' => array (2) ( 'file' => "CORE/core/format/variable.php", 'time' => 0.00262, ), 'Core\Bootstrap\Navbar' => array (2) ( 'file' => "CORE/core/bootstrap/navbar.php", 'time' => 0.00274, ), ) CORE/core.php : 186 BASE/index.php : 9 0.00432 - Debug "Done."