[WordPress] 外掛分享: WP Image Color Palette

首頁外掛目錄 › WP Image Color Palette
WordPress 外掛 WP Image Color Palette 的封面圖片
10+
安裝啟用
尚無評分
3138 天前
最後更新
問題解決
WordPress 4.8+ v1.4.0 上架:2017-07-05

內容簡介

特色:

從附件圖片中提取顏色並將其保存到文章元中。
多個 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 )

獲取圖像顏色色板。

啟用後

在您的「工具」菜單中訪問「圖像調色板」頁面。
檢查調試信息。 如果一切都看起來很好,您就可以關掉了。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Image Color Palette」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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.

文章
Filter
Apply Filters
Mastodon