Introducing MochiKit - MochiKit.Color and More
(Page 3 of 4 )
MochiKit.Color provides a useful abstraction layer for working with colors or strings that represent colors, as well as the full CSS3 color implementation. It standardizes color representations of RGB, HSL, SVG, HEX and HSV by setting any color to a value between 0 and 1. It was inspired by the NS color object from the Apple Cocoa environment.
MochiKit.DateTime provides an easy method for creating date objects from ISO 8601 timestamps and ISO8601 time strings and for converting them to the other way around. It also provides methods for converting American date strings to date objects.
MochiKit.Format provides some useful functions that deal with formatting strings and converting numbers to strings. It allows you to truncate a decimal number to a fixed precision as well as just rounding it, and provides a useful number formatter that formats numbers according to a specified locale or the local systems locale. This module is loosely based on the Number Format Pattern Syntax from Java.
MochiKit.Iter provides a standardized method of iterating over anything and was inspired by the iteration protocol of Python and the itertools module. The API for this one is huge and, as well as containing a lot of functional programming not found in MochiKit.base, contains a range of methods for grouping, sorting and chaining which return arrays from iterable objects.
MochiKit.Logger addresses the lack of native support of a standard console in JavaScript to log statements to. It removes the need for using alert() for debugging purposes and allows you to log all messages to the browser's native console. You are able to log debug, info error, fatal and warning messages to the log. The next module MochiKit.LoggingPane is used in conjunction with the previous module to provide somewhere for you to display the output of the logger, which can be inline with the page or as a popup.
Next: MochiKit.Selector and More >>
More JavaScript Articles
More By Dan Wellman