Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compass-canvas

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compass-canvas

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

compass-canvas

Canvas drawing support for Compass with Cairo backend(s)

Description

Canvas is a Compass plugin that provides a drawing surface similar to the <canvas> element in JavaScript and Turtle graphics in other programming languages. It uses Cairo as a back-end to perform all graphics operations. Canvas supports anti-aliasing, vector graphics, gradients, masks, clipping, complex operations like drop shadow and many more.

Installation

Installation is done through RubyGems:

gem install compass-canvas

Dependencies

The compass-canvas gem depends on the cairo gem. In order to install both gems, you must have Cairo's development files present on your system. You can usually install these using your OS package manager.

Ubuntu
sudo apt-get install libcairo2-dev

Example

@import 'canvas';

$shape: triangle(10, 10, 310, 10, 160, 190);

html {
  background: canvas(320, 200,
    $shape
    brush(10, 10, 160, 100, rgba(red, 0.5) 50%, rgba(red, 0.75))
    fill
    reset
    save
      translate(40, 20)
      scale(0.75, 0.75)
      $shape
      brush(black)
      stroke
      brush(10, 10, 160, 100, rgba(blue, 0.75) 50%, rgba(blue, 0.5))
      fill
    restore
  ) no-repeat 50% 50%;
}

License

Canvas is licensed under the MIT License.

Documentation

RDoc is available for the entire project.

For more information on Cairo, visit The Cairo graphics tutorial.

For a complete reference on Cairo methods, visit Pycairo documentation.

Similar Projects

compass-magick is a pure Ruby dynamic image generation for Compass using ChunkyPNG/PhantomJS (no dependency on RMagick despite the name). If you are looking for a project to generate image gradients or small & simple buttons, go check it out.

Copyright (c) 2011 Stan Angeloff. See LICENSE.md for details.

FAQs

Package last updated on 29 Aug 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc