Color.More 0.2

Provides additional functions for Mootools Color.



Details

Author
Tor Viktorsson
Current version
0.2
GitHub
robotacon/Color.More
Downloads
5424
Category
Native
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_:
    • Core/Array
    • Core/String
    • Core/Number
    • Core/Hash
    • Core/Function
    • MooTools.More
    • Color

How to use

Use in the following manner:

var darkerColor = myColor.multiply(color[, color2[, color3[, ...]);
var lighterColor = myColor.screen(color[, color2[, color3[, ...]);
var contrastColor = myColor.overlay(color[, color2[, color3[, ...]);

var dullerColor = myColor.dim(color, percentage);
var lightColor = myColor.light(color, percentage, reflex);
var brighterColor = myColor.shine(color, percentage, reflex);

Both percentage and reflex values should be a value between 0 and 1.

var normalColor = $NORMAL(x,y,size);

Coordinates x and y needs to range from 0 to size-1 if the area defined by size is to map the sphere perfectly. It's wise to use an uneven size because then the center coordinate will return a flat color ie a vector pointing straight at the viewer.

var flatColor = $NORMAL(6,6,15); // rgb(127, 127, 255) flat in the center of the sphere
var tiltedUpperLeftColor = $NORMAL(4,4,15); // rgb(75, 75, 232) slightly tilted surface
var tiltedLowerLeftColor = $NORMAL(3,13,15); // rgb(229, 58, 162) steep tilt on edge of the sphere

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus