The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::COLOURlovers - Interface to COLOURlovers.com's API

VERSION

version 0.01

SYNOPSIS

    use Net::COLOURlovers;

    my $cl = Net::COLOURlovers->new;

    my $pattern = $cl->pattern_random;
    my @colors = $cl->colors_top( { 'numResults' => 5 } );

A sample page built using this API can be found at: http://bit.ly/qtIepU.

METHOD FORMAT

Each method listed below has its input and output parametres specified in sections titled Input and Output. These sections are followed by the parametre type:

  • UNDEF - accepts no parametre

  • SCALAR - accepts/returns a SCALAR

  • HASHREF - accepts/returns a HASH

  • ARRAYREF of HASHREFs - accepts/returns an ARRAY reference which has HASH references as its elements

ATTRIBUTES

new

Constructs and returns a Net::COLOURlovers object.

METHODS

color

Input: SCALAR

  • 'color_name'

    A 6-character hexadecimal value like 6B4106.

Output: HASHREF

  • id

  • title

  • userName

  • numViews

  • numVotes

  • numComments

  • numHearts

  • rank

  • dateCreated

  • hex

  • rgb

    • red

    • green

    • blue

  • hsv

    • hue

    • saturation

    • value

  • description

  • url

  • imageUrl

  • badgeUrl

  • apiUrl

colors, colors_new and colors_top

Input: HASHREF (optional)

  • lover

  • hueRange

  • briRange

  • keywords

  • keywordExact

  • orderCol

  • sortBy

  • numResults

  • resultOffset

Output: ARRAYREF of HASHREFs

Format same as that for "color".

color_random

Input: UNDEF

Output: HASHREF

Format same as that for "color".

lover

Input: SCALAR

  • 'lover_name'

    A valid COLOURlovers.com username.

Output: HASHREF

  • userName

  • dateRegistered

  • dateLastActive

  • rating

  • location

  • numColors

  • numPalettes

  • numCommentsMade

  • numCommentsOnProfile

  • comments

  • url

  • apiUrl

lovers, lovers_new and lovers_top

Input: HASHREF (optional)

  • orderCol

  • sortBy

  • numResults

  • resultOffset

Output: ARRAYREF of HASHREFs

Format same as that for "lover".

palette

Input: SCALAR

  • 'palette_id'

    A valid palette ID like 113451.

Output: HASHREF

  • id

  • title

  • userName

  • numViews

  • numVotes

  • numComments

  • numHearts

  • rank

  • dateCreated

  • colors

  • description

  • url

  • imageUrl

  • badgeUrl

  • apiUrl

palettes, palettes_new and palettes_top

Input: HASHREF (optional)

  • lover

  • hueOption

  • hex

  • keywords

  • keywordExact

  • orderCol

  • sortBy

  • numResults

  • resultOffset

  • showPaletteWidths

Output: ARRAYREF of HASHREFs

Format same as that for "palette".

palette_random

Input: UNDEF

Output: HASHREF

Format same as that for "palette".

pattern

Input: SCALAR

  • 'pattern_id'

    A valid pattern ID like 1451.

Output: ARRAYREF of HASHREFs

  • id

  • title

  • userName

  • numViews

  • numVotes

  • numComments

  • numHearts

  • rank

  • dateCreated

  • colors

  • description

  • url

  • imageUrl

  • badgeUrl

  • apiUrl

patterns, patterns_new and patterns_top

Input: HASHREF (optional)

  • lover

  • hueOption

  • hex

  • keywords

  • keywordExact

  • orderCol

  • sortBy

  • numResults

  • resultOffset

Output: ARRAYREF of HASHREFs

Format same as that for "pattern".

pattern_random

Input: UNDEF

Output: HASHREF

Format same as that for "pattern".

stats_colors

Returns total number of colors.

stats_lovers

Returns total number of lovers.

stats_palettes

Returns total number of palettes.

stats_patterns

Returns total number of patterns.

SEE ALSO

COLOURLovers API Documentation

ATTRIBUTION CREDIT

COLOURlovers.com

AUTHOR

Alan Haggai Alavi <alanhaggai@alanhaggai.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Alan Haggai Alavi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.