Git Product home page Git Product logo

funky-image-meta's Introduction

funky-colors

A Wordpress plugin to detect a palette of colors from each image in the media library. Uses Color Extractor and provides Wordpress meta fields and UI.

How

  1. Install and activate the plugin, then navigate to Tools > Funky Colors.
  2. Press Detect Colors on All Images to detect and save color palettes on each image.
    1. You can view and edit the primary color any time by going to Media, then selecting the image and checking the "Primary Color" field.
  3. Use the convenience functions to work with image colors in your template.

Metadata

Funky Colors stores its data in a few meta fields: FIC_color for the primary color, FIC_secondary_color for the manually-set secondary color, and FIC_palette for the image's palette.

It's best to use the get_second_image_color function to find an image's secondary color, since it will fall back to the appropriate value if FIC_secondary_color is not set.

You can use $your_attachment->FIC_color to find the main hex color of an image and $your_attachment->FIC_palette[1] to find the secondary hex color. The FIC_palette works like a zero-indexed array - substitute 1 with any number between 2 and 4 to try to find the third to fifth most common colors.

Convenience Functions

  • get_primary_image_color( $attachment_id ) Returns the hex value of an image's primary color, if it has one. Returns an empty string otherwise.
  • get_second_image_color( $attachment_id ) Returns the hex value of an image's secondary color, if it has one. Uses the manually-set value first, then falls back to the secondary color from the palette. Returns an empty string if none found.

funky-colors

http://funkhaus.us

Version: 1.2

Requires at least WP 3.8

funky-image-meta's People

Contributors

safrmo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.