mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-03 00:43:13 +00:00
Added grabbing average image colour function
This commit is contained in:
parent
7abf0c47ce
commit
33927c63ef
9 changed files with 196 additions and 40 deletions
20
profile.php
20
profile.php
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
require_once __DIR__."/app/required.php";
|
||||
|
||||
use App\Account;
|
||||
use App\Diff;
|
||||
use App\Make;
|
||||
use App\Account;
|
||||
use App\Diff;
|
||||
|
||||
$make_stuff = new Make();
|
||||
$user_info = new Account();
|
||||
$diff = new Diff();
|
||||
|
||||
|
@ -30,6 +32,20 @@
|
|||
if (!empty($user)) {
|
||||
if (is_file("images/pfp/".$user['pfp_path'])) {
|
||||
echo "<img src='images/pfp/".$user['pfp_path']."'>";
|
||||
|
||||
$pfp_colour = $make_stuff->get_image_colour("images/pfp/".$user['pfp_path']);
|
||||
if (!empty($pfp_colour)) {
|
||||
$pfp_colour = $pfp_colour;
|
||||
} else {
|
||||
$pfp_colour = "var(--bg-3)";
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.profile-root {
|
||||
background-image: linear-gradient(to right, <?php echo $pfp_colour; ?>, var(--bg-3)) !important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
} else {
|
||||
echo "<img src='assets/no_image.png'>";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue