Giter Club home page Giter Club logo

adobe-swatch-importer's Introduction

##adobe-swatch-importer## WORK IN PROGRESS
requireJS Module for parsing and converting ACO/ASE Swatch Palettes in RGB Hashes (Supported: RGB, CMYK, HSV)

The module awaits jDataView (https://github.com/jDataView/jDataView) Objects due to BigEndian support for binary Files.

Demo Gif Animation

Get Instance of Importer Class:
var instance = Swatchimporter(Swatchfile format)

Get back all parseable Colors as Objects:
instance.getColors(jDataView Object)

SwatchImporter Function returns an Instance with following Attributes:

[{  
    version: 2                // Swatchformat Version  
    amount: 1                 // Amount of Colors  
    colors: [Array]           // All Colorobjects  
    converted: 0              // Indicator for CMYK converted Colors  
    skipped: 0                // Indicator for skipped Colors (No Converters, wrong Colorspace)  
    byteIndex: 0              // byteIndex dont change (TODO: make private)  
    error: false              // Parseerror Indicator  
}]  

getColors() returns an Array of Color() Objects (Example: 1 Color in Swatchfile pure red):

[{  
	swatchType: "ACO",        // From which type converted  
	name: "Swatch 1",         // Name of Swatch
	origin: [65535,0,0],      // Colorvalues from Swatchfile  
	originFormat: "RGB",      // Convertinfo  
	rgb: [255,0,0],           // converted values from Swatchfile Colorvalues to rgb  
	hash: "#FF0000"           // converted hash  
}]  

Example:

try {
  var data = jDataView(rawData);
  var importer = SwatchImporter('aco');
  var palette = importer.getColors(data);
  console.log(palette);
} catch(e) {
  console.error(e.message);
}

##Todo##

  • LAB Converters/Support for LAB Colorspace
  • Proper Support for ASE Swatch Grouping (For now there is just simple Kuler support)

##Changelog##

  • 11 April 2015
    -- Fixed ASE CMYK Conversion
    -- String Encoding
    -- Properties for converted and skipped Colors
    -- Changed originFormat representation
    -- Kuler ASE Swatchgrouping Hack

  • 8 April 2015
    -- First Version
    -- Support for RGB, CMYK and HSV

Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license
Adobe is a registered trademark of Adobe Systems Incorporated.

adobe-swatch-importer's People

Contributors

freakzero avatar

Watchers

 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.