User:Harthur/ColorConversion
Jump to navigation
Jump to search
About
download: colorCommon.js
This is a javascript library for converting colors between different color formats. It supports rgb, hsl, and hsv. To call a method of the library simply say colorCommon.methodName(). Valid color strings can take one of the following formats: #00FF00, rgb(0, 255, 0), rgb(0%, 100%, 0%), hsl(120, 100%, 50%), hsv(120, 100%, 100%)
API
toHex
gets a Hex string for a color
parameter:
- any valid color string
return:
- a string of the color in hex format
example:
bugzillaRPC.getBug(48875,
function(bug) {alert(bug.summary);},
function(errMsg) {alert(errMsg)});
getBugs
Retrieves an array of bug objects
parameters:
- ids - an array of bug ids
- callback
- errback
success parameter:
- bugs - An array of objects defined by Bugzilla XML-RPC's getBugs return value. with properties id, summary, creation_time, last_change_time, and the internals object which has various other properties.
example:
bugzillaRPC.getBugs([8117, 2344],
function(bugs) {alert(bugs[0].summary);},
function(errMsg) {alert(errMsg)});