Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1461b6d
Combined the dominant_color_get_dominant_color() and the dominant_col…
pbearne Jun 16, 2022
d7c2b9d
Combined the dominant_color_get_dominant_color() and the dominant_col…
pbearne Jun 16, 2022
d58f2b4
Combined the dominant_color_get_dominant_color() and the dominant_col…
pbearne Jun 16, 2022
2158a17
Update modules/images/dominant-color/load.php
pbearne Jun 20, 2022
198532c
Force hex to 6 characters
spacedmonkey Jun 22, 2022
a6ab609
Merge branch 'trunk' into INITS-976-Avoid_duplicate_execution_of_sett…
spacedmonkey Jun 22, 2022
37b3222
changed code to return WP_error in has_transparency or dominant_color…
pbearne Jun 24, 2022
b01ba33
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
c6f0f2b
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
ec6e41a
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
57ab283
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
43e3dd1
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
e4b2e03
Update modules/images/dominant-color/load.php
pbearne Jun 24, 2022
1d2e440
Removed magic code for simpler str_pad function
pbearne Jun 24, 2022
43b5268
Improve unit tests.
spacedmonkey Jun 27, 2022
e75e578
Add get_hex_from_rgb function.
spacedmonkey Jun 27, 2022
83d2cce
Remove test for now.
spacedmonkey Jun 27, 2022
3018d7e
Return wp_error.
spacedmonkey Jun 27, 2022
4e130cb
Change message.
spacedmonkey Jun 27, 2022
043feb2
Check to see if the method exists.
spacedmonkey Jun 27, 2022
879a43f
Improve testing.
spacedmonkey Jun 27, 2022
a9acc67
Ignore on multisite.
spacedmonkey Jun 27, 2022
e5f2054
Change function name.
spacedmonkey Jun 28, 2022
14073b6
Apply suggestions from code review
spacedmonkey Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ public function get_dominant_color() {
$shorted_image = imagecreatetruecolor( 1, 1 );
imagecopyresampled( $shorted_image, $this->image, 0, 0, 0, 0, 1, 1, imagesx( $this->image ), imagesy( $this->image ) );

$rgb = imagecolorat( $shorted_image, 0, 0 );
$r = ( $rgb >> 16 ) & 0xFF;
$g = ( $rgb >> 8 ) & 0xFF;
$b = $rgb & 0xFF;
return sprintf( '%02x%02x%02x', $r, $g, $b );
return str_pad( dechex( imagecolorat( $shorted_image, 0, 0 ) ), 6, '0', STR_PAD_LEFT );
}


Expand Down