Hi, I'm noticing that using the analogic, etc. functions more than once gives you a fatal error: Cannot redeclare class colorHarmony in /sites/all/modules/dcss/plugins/color_harmony.class.php on line 224.
Also, in trying to figure out what parameters to pass the function, if I get it wrong I end up with a fatal php error instead of a drupal error message. When you get around to it, doing some error checking in the api could avoid this ugly situation.

Comments

colemanw’s picture

Got it: above bug can be fixed by changing "include" function to "include_once" on 249 of dcss.inc

colemanw’s picture

There seems to be an issue with the analogous function: passing it a value of '1' (I'm not sure why your numeric arguments have to be strings, but they do or else fatal errors ensue) gives the correct output (rotating around the color wheel in one direction), but trying to go the other direction doesn't work (I tried '-1' and '2', both give fatal errors).

colemanw’s picture

The compliment function doesn't seem to work (or else I can't figure out how to pass the arguments). For example, I passed it the value #78AA54. The result it gave was #BCD5AA. I thought it didn't look right, so I looked it up on colorschemedesigner.com. The real compliment to #78AA54 is #AE566E. Any tips on this would be appreciated.

colemanw’s picture

nudge

danmasq’s picture

The algorithm that I used dcss_color provides an array of phases for each color relationship chosen (e.g. ... 'complement', [phase_array])

Although I'm not sure how to match colorschemedesigner dead on, I was able to return a color that was only one shade and saturation level off of #AE566E (it ends up being #80BC92). The array position for this color is 3.

Try this out:

background-color:<?php print dcss_color('#78AA54', '0', 'bg', NULL, 'complement', 3); ?>; /* returns #80BC92 */

if you're getting the fatal errors still, you should try changing the following:

color_harmony.class.php - line 10 - include('color_converter.class.php'); to include_once('color_converter.class.php');
in dcss_color(), use: include('plugins/color_harmony.class.php'); and include_once("plugins/csscolor.php");

Each relationship outputs 8 array items. You can try 0, 1, 2, 3, 4, 5, 6, 7, or 8 in the $phase argument of dcss_color()

Hope that helped.

p.s. We'll be releasing a new version of dcss with a ton of fixes and useful new methods soon (with the previously mentioned fixes included).