File:Amstrad CPC ink numbers.png

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file(4,500 × 2,000 pixels, file size: 347 KB, MIME type: image/png)

Summary

Description
English: The Amstrad CPC colour palette, also showing which ink numbers to use in Locomotive BASIC, e.g. with the INK or BORDER commands, and the official colour names by Amstrad. The layout is based on a post by user MacDeath on the CPCWiki forum: https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-palette/msg53168/#msg53168


Motivation: The Amstrad CPC palette order works like this: blue intensity is increased/cycled most quickly (from zero to half to full), then red intensity is the next slower cycle, and green is the slowest component. Obviously, that means that 0 = black and 26 = white, but the colours in between are a jumbled mess when presented in ink order. Whereas this arrangement here is one that makes more sense artistically, grouping light (pastel), dark, and medium colours together on different rows and putting the six colours where one component is full, one is half, and one is zero in a block on the right-hand side.
Date
Source Own work
Author Morn
Other versions
Sorted by ink number
PNG development
InfoField
 
This PNG graphic was created with Python.
Source code
InfoField

Python code

Source code
# Show Amstrad CPC palette and INK numbers and names

from PIL import Image, ImageDraw, ImageFont

SIZE = 500
BORDER = 20

fnt = ImageFont.truetype('/usr/share/fonts/TTF/Courier Prime.ttf', SIZE//3)
fnt2 = ImageFont.truetype('/usr/share/fonts/TTF/Courier Prime.ttf', SIZE//10)
fnt3 = ImageFont.truetype('/usr/share/fonts/TTF/IBMPlexSans-SemiBold.ttf', SIZE//1.7)
out = Image.new("RGB", (9 * SIZE, 4 * SIZE))
d = ImageDraw.Draw(out)

# CPC color layout as in the image by MacDeath on the CPCWiki forum:
# https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-palette/msg53168/#msg53168
cols = (
"h000h000hh0hhh00hh000hf0fh0",
"f000f000ff0fff00ffhhhh0ff0h",
"fhhhfhhhffhfffhhfffff0hf0fh",
)

# colour names from Chapter 1, page 48 of the CPC6128 user manual:
names = (
"Black",
"Blue",
"Bright Blue",
"Red",
"Magenta",
"Mauve",
"Bright Red",
"Purple",
"Bright Magenta",
"Green",
"Cyan",
"Sky Blue",
"Yellow",
"White",
"Pastel Blue",
"Orange",
"Pink",
"Pastel Magenta",
"Bright Green",
"Sea Green",
"Bright Cyan",
"Lime Green",
"Pastel Green",
"Pastel Cyan",
"Bright Yellow",
"Pastel Yellow",
"Bright White",
)

def getcol(c):
    "Convert color text to tuple"
    o = []
    for x in c:
        if x == "h":
            o.append(128)
        elif x == "f":
            o.append(255)
        else:
            o.append(0)

    # based on pseudocode at https://www.grimware.org/doku.php/documentations/devices/gatearray
    ink = 0
    if c[0] == "f": ink += 6
    if c[0] == "h": ink += 3
    if c[1] == "f": ink += 18
    if c[1] == "h": ink += 9
    if c[2] == "f": ink += 2
    if c[2] == "h": ink += 1
    return tuple(o), ink

for j in range(3):
    for i in range(9):
        c, ink = getcol(cols[j][3 * i:3 * i + 3])
        p1 = i * SIZE + BORDER, (j + 1) * SIZE + BORDER
        p2 = (i + 1) * SIZE - BORDER, (j + 2) * SIZE - BORDER
        p3 = p1[0], p1[1] + SIZE//3
        d.rectangle((p1, p2), fill = c)
        d.text(p1, "%u" % ink, font = fnt, fill = (0, 0, 0), align = "left", valign = "top", stroke_width = 15)
        d.text(p1, "%u" % ink, font = fnt, fill = (255, 255, 255), align = "left", valign = "top")
        d.text(p3, names[ink], font = fnt2, fill = (0, 0, 0), align = "left", valign = "top", stroke_width = 6)
        d.text(p3, names[ink], font = fnt2, fill = (255, 255, 255), align = "left", valign = "top")

d.text((1.6 * SIZE, SIZE//6), "Amstrad CPC palette", font = fnt3, fill = (255, 255, 255))

out.save("Amstrad_CPC_ink_numbers_names_header_plex.png")

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

23 December 2023

image/png

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:17, 23 December 2023Thumbnail for version as of 18:17, 23 December 20234,500 × 2,000 (347 KB)Mornchange font
16:27, 23 December 2023Thumbnail for version as of 16:27, 23 December 20234,500 × 2,000 (343 KB)Mornadd title
15:59, 23 December 2023Thumbnail for version as of 15:59, 23 December 20234,500 × 1,500 (293 KB)Mornadd colour names
12:51, 23 December 2023Thumbnail for version as of 12:51, 23 December 20234,500 × 1,500 (169 KB)MornUploaded own work with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):