From: vincent@cubedesigners.com Date: Tue, 20 Jul 2021 13:37:59 +0000 (+0000) Subject: wip #4600 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a420c65185e84cbd8cf6b462841240bd31e44fb8;p=cubeextranet.git wip #4600 @0.5 --- diff --git a/inc/ws/Util/html5/class.ws.html5.php b/inc/ws/Util/html5/class.ws.html5.php index a6c7d6f6b..56320f192 100644 --- a/inc/ws/Util/html5/class.ws.html5.php +++ b/inc/ws/Util/html5/class.ws.html5.php @@ -16,7 +16,7 @@ class wsHTML5 * @param null $book * @return wsHTML5Compiler */ - public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null,$forceTheme=false) + public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false) { if (is_null($version)) { global $core; @@ -46,7 +46,7 @@ class wsHTML5 } } - return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book,$forceTheme); + return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme); } public static function getPhonegapVersion($v = 'latest') @@ -87,24 +87,6 @@ class wsHTML5 return implode(';', $res) . ';'; } - public static function colorToArray($color, $forceAlpha = null) - { - $color = ltrim($color, '#'); - if (strlen($color) == 6) { - $hex = $color; - $alpha = 1; - } else { - $alpha = hexdec(substr($color, 0, 2)) / 255; - $hex = substr($color, 2, 6); - } - - if (!is_null($forceAlpha)) { - $alpha = $forceAlpha; - } - - return array('hex' => strtoupper($hex), 'opacity' => number_format($alpha, 3, '.', '')); - } - public static function colorToCSS($color, $forceAlpha = null) { return CubeIT_Graphics_Color::colorToCSS($color, $forceAlpha); diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index f65b7cf86..010f31273 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -2367,7 +2367,8 @@ height="0" width="0" style="display:none;visibility:hidden"> $this->lessVariables['book-page-ratio'] = floatval($w) / floatval($h); $this->lessVariables['page-shade-opacity'] = min(1, $this->theme->parametres->shadeAlpha / 50); - $this->lessVariables['shadow-opacity'] = wsHTML5::colorToArray($this->theme->parametres->bookShadeColor)['opacity'] * 1.2; + $c= new CubeIT_Graphics_Color($this->theme->parametres->bookShadeColor); + $this->lessVariables['shadow-opacity'] = $c->getAlpha() * 1.2; $this->lessVariables['edges-display'] = $this->_lessBoolean($this->theme->parametres->usePageEdges); $this->lessVariables['edge-left-offset'] = 0; $this->lessVariables['edge-right-offset'] = 0;