Term::Caca - Use libcaca (Colour AsCii Art library) API in Perl 6
Other
Switch branches/tags
Nothing to show
Latest commit 54cb491 May 23, 2017 @azawawi Add missing hashbang
Permalink
Failed to load latest commit information.
examples Add missing hashbang May 23, 2017
lib/Terminal Some refactoring May 20, 2017
logotype Add libcaca 32x32 module logo May 3, 2017
t Add the OO kebab-case API (cooked) and rename old to ::Raw May 2, 2017
.gitignore
.travis.yml Add Travis CI May 2, 2017
LICENSE
META6.json Bump version to 0.5.3 May 4, 2017
README.md Less code May 12, 2017
camelia-logo.ppm Add initial .dither-image with Camelia example :) May 4, 2017

README.md

Terminal::Caca Build Status

Terminal::Caca - Use libcaca (Colour AsCii Art library) API in Perl 6

NOTE: The library is currently experimental. You have been warned :)

Normally you would use the safer object-oriented API via Terminal::Caca. If you need to access raw API for any reason, please use Terminal::Caca::Raw.

Example

use v6;
use Terminal::Caca;

# Initialize library
given my $o = Terminal::Caca.new {
    # Set window title
    .title("Perl 6 rocks");

    # Say hello world
    my $text = ' Hello world, from Perl 6! ';
    .color(white, blue);
    .text(10, 10, $text);

    # Draw an ASCII-art box around it
    .thin-box(9, 9, $text.chars + 2, 3);

    # Refresh display
    .refresh;

    # Wait for a key press event
    .wait-for-keypress;

    # Cleanup on scope exit
    LEAVE {
        .cleanup;
    }
}

For more examples, please see the examples folder.

Installation

  • On Debian-based linux distributions, please use the following command:
$ sudo apt-get install libcaca-dev
  • On Mac OS X, please use the following command:
$ brew update
$ brew install libcaca
  • Using zef (a module management tool bundled with Rakudo Star):
$ zef install Terminal::Caca

Testing

  • To run tests:
$ prove -ve "perl6 -Ilib"
  • To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"

Author

Ahmad M. Zawawi, azawawi on #perl6, https://github.com/azawawi/

License

MIT