
內容簡介
特色:
從附件圖片中提取顏色並將其保存到文章元中。
多個 php 函數可從圖像中提取數據或接收文章元。
PHP 函數
您可以在文章元中找到您的圖像樣本。 有兩個全局 php 函數可獲取這些值:
wpip_get_post_thumbnail_color( int|WP_Post $post )
從文章中獲取主要的 RGB 顏色。
wpip_get_post_thumbnail_colors( int|WP_Post $post )
從文章中獲取主要的 RGB 顏色。
進階用戶也可以喜歡以下函數,從 WordPress 中的任何圖像中提取顏色。
wpip_get_image_color( string $file, int $precision = 20, int $palette_length = 5 )
從圖像中獲取主要的顏色。
wpip_get_image_colors( string $file, int $precision = 20, int $palette_length = 5 )
獲取圖像顏色色板。
啟用後
在您的「工具」菜單中訪問「圖像調色板」頁面。
檢查調試信息。 如果一切都看起來很好,您就可以關掉了。
外掛標籤
開發者團隊
原文外掛簡介
Features:
Extracts colors from attachment images and saves it to the post meta.
Several php functions to receive the post meta or extract data from images on the fly.
PHP functions
You can find your image swatches in the post meta. There are two global php functions to get these values:
wpip_get_post_thumbnail_color( int|WP_Post $post )
Gets the main rgb color from a post.
wpip_get_post_thumbnail_colors( int|WP_Post $post )
Gets the main rgb colors from a post.
Advanced users may also like the following functions to extract the colors from any image they want in WordPress.
wpip_get_image_color( string $file, int $precision = 20, int $palette_length = 5 )
Gets the main color from an image.
wpip_get_image_colors( string $file, int $precision = 20, int $palette_length = 5 )
Gets the image color palette.
After activation
Visit the ‘Image Color Palette’ page in your ‘Tools’ menu.
Check the Debug information. If everything looks good, you are ready to off.
