summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-08-06 12:54:39 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-08-06 12:54:39 +0000
commit893b0fbd5c271547726065a461336714d9016dfc (patch)
tree154bf8ea6a62683c255d4ae1f5ffc511332e0022 /modules
parent0f33e78deda252d3732e46e8a3b97670b3cda565 (diff)
downloadbrdo-893b0fbd5c271547726065a461336714d9016dfc.tar.gz
brdo-893b0fbd5c271547726065a461336714d9016dfc.tar.bz2
#141653 by Ralf Stamm: fix some E_NOTICE errors in color module
Diffstat (limited to 'modules')
-rw-r--r--modules/color/color.module7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/color/color.module b/modules/color/color.module
index 90a17a67d..1f3a15442 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -221,7 +221,7 @@ function color_scheme_form_submit($form, &$form_state) {
foreach (variable_get('color_'. $theme .'_files', array()) as $file) {
@unlink($file);
}
- if ($file = dirname($file)) {
+ if (isset($file) && $file = dirname($file)) {
@rmdir($file);
}
@@ -279,7 +279,7 @@ function color_scheme_form_submit($form, &$form_state) {
function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette) {
// Load stylesheet
$themes = list_themes();
- $style = file_get_contents($themes[$theme]->stylesheet);
+ $style = file_get_contents($themes[$theme]->stylesheets['all']['style.css']);
// Prepare color conversion table
$conversion = $palette;
@@ -447,6 +447,8 @@ function _color_shift($given, $ref1, $ref2, $target) {
$target = _color_unpack($target, true);
$ref1 = _color_unpack($ref1, true);
$ref2 = _color_unpack($ref2, true);
+ $numerator = 0;
+ $denominator = 0;
for ($i = 0; $i < 3; ++$i) {
$numerator += ($ref2[$i] - $ref1[$i]) * ($ref2[$i] - $ref1[$i]);
$denominator += ($target[$i] - $ref1[$i]) * ($target[$i] - $ref1[$i]);
@@ -523,6 +525,7 @@ function _color_unpack($hex, $normalize = false) {
* Convert an RGB triplet to a hex color.
*/
function _color_pack($rgb, $normalize = false) {
+ $out = 0;
foreach ($rgb as $k => $v) {
$out |= (($v * ($normalize ? 255 : 1)) << (16 - $k * 8));
}