Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
ac399fd4
Commit
ac399fd4
authored
Dec 04, 2006
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style
parent
b7094195
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
modules/color/color.module
modules/color/color.module
+10
-10
No files found.
modules/color/color.module
View file @
ac399fd4
...
...
@@ -335,13 +335,13 @@ function _color_import_stylesheet($matches) {
*/
function
_color_render_images
(
$theme
,
&
$info
,
&
$paths
,
$palette
)
{
// Prepare template image
// Prepare template image
.
$source
=
$paths
[
'source'
]
.
'/'
.
$info
[
'base_image'
];
$source
=
imagecreatefrompng
(
$source
);
// Prepare target buffer
$width
=
imagesx
(
$source
);
$height
=
imagesy
(
$source
);
// Prepare target buffer.
$target
=
imagecreatetruecolor
(
$width
,
$height
);
imagealphablending
(
$target
,
true
);
...
...
@@ -350,25 +350,25 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
imagefilledrectangle
(
$target
,
$fill
[
0
],
$fill
[
1
],
$fill
[
0
]
+
$fill
[
2
],
$fill
[
1
]
+
$fill
[
3
],
_color_gd
(
$target
,
$palette
[
$color
]));
}
// Render gradient
// Render gradient
.
for
(
$y
=
0
;
$y
<
$info
[
'gradient'
][
3
];
++
$y
)
{
$color
=
_color_blend
(
$target
,
$palette
[
'top'
],
$palette
[
'bottom'
],
$y
/
(
$info
[
'gradient'
][
3
]
-
1
));
imagefilledrectangle
(
$target
,
$info
[
'gradient'
][
0
],
$info
[
'gradient'
][
1
]
+
$y
,
$info
[
'gradient'
][
2
],
$info
[
'gradient'
][
1
]
+
$y
+
1
,
$color
);
}
// Blend over template
// Blend over template
.
imagecopy
(
$target
,
$source
,
0
,
0
,
0
,
0
,
$width
,
$height
);
// Clean up template image
// Clean up template image
.
imagedestroy
(
$source
);
// Cut out slices
// Cut out slices
.
foreach
(
$info
[
'slices'
]
as
$file
=>
$coord
)
{
list
(
$x
,
$y
,
$width
,
$height
)
=
$coord
;
$base
=
basename
(
$file
);
$image
=
$paths
[
'target'
]
.
$base
;
// Cut out slice
// Cut out slice
.
if
(
$file
==
'screenshot.png'
)
{
$slice
=
imagecreatetruecolor
(
150
,
90
);
imagecopyresampled
(
$slice
,
$target
,
0
,
0
,
$x
,
$y
,
150
,
90
,
$width
,
$height
);
...
...
@@ -379,7 +379,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
imagecopy
(
$slice
,
$target
,
0
,
0
,
$x
,
$y
,
$width
,
$height
);
}
// Save image
// Save image
.
imagepng
(
$slice
,
$image
);
imagedestroy
(
$slice
);
$paths
[
'files'
][]
=
$image
;
...
...
@@ -388,7 +388,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
$paths
[
'map'
][
$file
]
=
$base
;
}
// Clean up target buffer
// Clean up target buffer
.
imagedestroy
(
$target
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment