Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
8 Commits
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.