GithubHelp home page GithubHelp logo

industrialsynthfreak / acorn256 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 16 KB

Acorn256 (Archimedes Computers) color palette converter. Converts between Acorn256/16 and RGB256 / HTML / HSV color formats.

Python 100.00%
archimedes python acorn

acorn256's Introduction

acorn256

Acorn256 (Archimedes Computers) color palette converter. Converts between Acorn256/16 and RGB256 / HTML / HSV color formats.

ACORN256 / ACORN16 default color palettes, which were implemented in 'Acorn Archimedes' computers. Because obviously there are no complete match between 8-bit and 24-bit palettes, some of the RGB / HTML / HSV values provided will return None. One should not use this code to convert between rgb and html and etc. because only values, that match Acorn palette, going to be converted.

Syntax

convert([input_format], [output_format], [value], [optional: palette])

  • input_format, output_format - any of: 'hsv', 'rgb', 'acorn', 'html'
  • value - must match the input format conventions, '#FFFFFF' for html, 0-255 for acorn256 and 0-15 for acorn16, tuple of UInt8 for hsv or rgb
  • palette - 'acorn16' or 'acorn256', default is acorn256

Examples

From interpreter / script:

from acorn256 import convert
acorn256.convert('acorn', 'html', 42)
'#226666'

From the terminal:

$ python3 acorn256.py rgb acorn '(255, 255, 255)'
255

Of course you can make an executable from it:

$ mv acorn256.py acorn256
$ chmod u+x acorn256
$ ./acorn256 rgb acorn '(255,255,255)' acorn16
0

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.