Coder Social home page Coder Social logo

jlk.colour's Introduction

jlk.colour

A simple colour library for Common Lisp.

Usage

First call function set-internal-colour-format to match the usage within your applicaiton or use internal-colour-format as a dynamic variable.

Then call function set-default-palette or use *default-palette* as a dynamic binding, providing a palette as an argument. A palette can be created using the make-palette function - see make-simple-palette, make-html4-palette and make-web-palette for examples.

Define an index by calling set-default-index and make-index.

reset-defaults can be used to set somewhat sane default values.

Colour names are defined using case-sensitive keywords. Lower case names are used, with an alias automatically created to the camel-case synonym.

To get a colour from the library, use get-colour. Note this will return the value specified in the palette as :default-colour when not found, or nil if undefined.

To search for a colour in the library, use find-colour.

To create a new colour use defcolour or use the make-colour-* functions. It is assumed you know the type of the input data when you make a colour, so * refers to the input format. You will also need to re-create the index using make-index after defining new colours.

To define a new type of internal colour format, define the methods for conversion -make-colour-*-* from the data type of interest to the custom format. See examples.lisp.

Licence

BSD 3-Clause, see LICENCE file in the repository

jlk.colour's People

Watchers

JLK avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.