Title: WP Image Color Palette
Author: mkronenfeld
Published: <strong>2017 年 7 月 6 日</strong>
Last modified: 2017 年 8 月 14 日

---

搜索插件

![](https://ps.w.org/wp-image-color-palette/assets/banner-772x250.jpg?rev=1713321)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/wp-image-color-palette/assets/icon-256x256.jpg?rev=1713321)

# WP Image Color Palette

 作者：[mkronenfeld](https://profiles.wordpress.org/mkronenfeld/)

[下载](https://downloads.wordpress.org/plugin/wp-image-color-palette.1.4.0.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-image-color-palette/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-image-color-palette/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-image-color-palette/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-image-color-palette/#developers)

 [支持](https://wordpress.org/support/plugin/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

 1. Visit the ‘Image Color Palette’ page in your ‘Tools’ menu.
 2. Check the Debug information. If everything looks good, you are ready to off.

## 安装

 1. Visit ‘Plugins > Add New’
 2. Search for ‘WP Image Color Palette’
 3. Activate WP Image Color Palette from your Plugins page.
 4. Go to “after activation” below.

## 常见问题

  Installation Instructions

 1. Visit ‘Plugins > Add New’
 2. Search for ‘WP Image Color Palette’
 3. Activate WP Image Color Palette from your Plugins page.
 4. Go to “after activation” below.

  How can I get the colors from my post?

Short: `wpip_get_post_thumbnail_colors`

You can find a list of all functions in the PHP functions section.

  Why are there no colors in my post?

Short: Update your post (again).

The color palette for a post is generated the moment you save a post or page. So
you have to save a post at least once, after the Plugin was activated.

A functionality for a bulk update is already on the roadmap.

  Why is post type XY not in the post-type list?

Only post types with ‘custom-fields’ support can be selected. Check your post type
with the [post_type_support](https://codex.wordpress.org/Function_Reference/post_type_supports)
function.

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP Image Color Palette」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ mkronenfeld ](https://profiles.wordpress.org/mkronenfeld/)

[帮助将「WP Image Color Palette」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-image-color-palette)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-image-color-palette/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/wp-image-color-palette/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/wp-image-color-palette/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-image-color-palette/)。

## 更新日志

#### 1.4

Release Date: August 14th, 2017

 * Enhancements
    - New bulk ‘Update the Image Color Palette’ action for your selected post type.
    - Improved the debugging section in the admin area.
       * Traffic lights status
       * Human readable error list
       * Settings dump for error reports
    - Switched the precision input type in the Admin area into a select list.
       * Decreased the default precision from 20 to 25.
    - Added global functions to the README file.
    - Added plugin assets for the WordPress.org SVN.

#### 1.3.1

Release Date: Juli 27th, 2017

 * Bugfixes
    - Fixed the Palette length field in the admin area.

#### 1.3

Release Date: Juli 22nd, 2017

 * Enhancements
    - Now the Image Color Palette plugin is really able to save the whole image 
      palette!
       * Added the global function `wpip_get_post_thumbnail_colors`
       * Check the FAQ for more useful functions.
    - Uninstalling the plugin now removes all of its post meta and plugin option.
    - Minor performance improvements due to better conditional loading behaviour.

#### 1.2

Release Date: Juli 9th, 2017

 * Enhancements
    - Admin users can change several plugin options in the admin area.
       * Post type, default: post
       * Precision, default: 20
       * Palette length, default: 3
       * Graphics library, default: gd
    - Improved FAQ section for the WordPress.org plugin page.

#### 1.1

Release Date: July 7th, 2017

 * Enhancements
    - Added the ‘Image Color Palette’ settings page to the ‘Tools’ menu.

## 额外信息

 *  版本 **1.4.0**
 *  最后更新：**9 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 4.8 或更高版本 **
 *  已测试的最高版本为 **4.8.33**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-image-color-palette/)
 * 标签
 * [extraction](https://cn.wordpress.org/plugins/tags/extraction/)[image](https://cn.wordpress.org/plugins/tags/image/)
   [swatches](https://cn.wordpress.org/plugins/tags/swatches/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-image-color-palette/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/wp-image-color-palette/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-image-color-palette/reviews/)

## 贡献者

 *   [ mkronenfeld ](https://profiles.wordpress.org/mkronenfeld/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-image-color-palette/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://wp-styles.de)