Dominant Color

外掛說明

A WordPress plugin to automatically save the dominant color and a color palette for an attachment image into post_meta.

螢幕擷圖

  • Shows the plugin in use on hellobrstl.com
  • Shows the plugin in use on hellobrstl.com
  • Shows the plugin in use on hellobrstl.com

安裝方式

The dominant color and color palette is automatically saved on upload and edit to post meta.

You need to then use get_post_meta to retrieve the “dominant_color_hex” or “dominant_color_rgb” meta key. hex returns a string, including the #, rgb returns an array with key 0 as red, 1 as green, and 2 as blue.

Alternatively, you can use the meta keys “color_palette_rgb” and “color_palette_hex” to get an array of 8 colors that feature prominently in the image.

使用者評論

2019 年 10 月 29 日
Useful plugin, please add function to bulk edit all images on gallery 🥰
2016 年 9 月 3 日
Pulls out both the dominant color and a nice color palette. Far more efficient to do this calculation once on upload rather than via PHP or JavaScript when rendering the page. Perfect!
2016 年 9 月 3 日
I had to search the post_meta table to find out how the 'dominant_override' meta_key - it would have been useful to find that in the release notes. A bulk calculate feature would be excellent - along with a way of colour picking the override from the posts screen in the WP Dashboard. Otherwise, perfect for what I need 🙂
閱讀全部 4 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Dominant Color〉的開發相關工作。

參與者

Dominant Color 外掛目前已有 3 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Dominant Color〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

2.2.0

Modernise javascript for deprecated jQuery handlers
Update to latest version of PHP Color Thief
Bump version requirements to match color thief and a modern-ish WordPress (5.4+)

2.1.0

Support translated languages (Submit your translation at translate.wordpress.org!)

2.0.1

Fix a bug where loading our JS in the footer would cause a javascript error.

2.0

Add a colour picker to the attachment edit screen to override the dominant color with a custom pick.
The WordPress media gallery will now let you pick a dominant color override which will be returned in place of dominant_color_hex/rgb when set.
It’ll also let you generate a palette for legacy images uploaded before you installed the plugin.

1.0

Initial Build