Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/kit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: kit

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
# The whole format matrix, not a sample: see check/kit.py.
complete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: python3 check/kit.py

# svg/color/go-scikit.svg is what mark/main.go writes: the stack of member
# organisations, laid out by the program, not drawn. This writes it again and fails if a
# byte differs, so the mark cannot drift from the program that defines it.
# (The PNG, JPG, ICO, ICNS, avatar and social files are rendered from that
# SVG by logos/brandgen; check/kit.py above counts them.)
mark:
name: the mark is what its program writes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: mark/go.mod
cache: false
- name: Write the mark
working-directory: mark
run: go run . > ../svg/color/go-scikit.svg
- name: The committed mark is the one written
run: |
if ! git diff --exit-code --stat -- svg/color/go-scikit.svg; then
echo "::error::svg/color/go-scikit.svg differs from what mark/main.go writes: run 'cd mark && go run . > ../svg/color/go-scikit.svg', then regenerate the kit with logos/brandgen"
exit 1
fi
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# brand
Logo, icons and social images of go-scikit
# go-scikit — brand assets

Official logos for the **go-scikit** organization, the umbrella over the
fleet's scientific Go work.

<img src="avatar/go-scikit.png" width="160" alt="go-scikit">

The mark is the stack drawn as a building. The base is the arrays, one plate
cut in two: go-ndarray and go-fft. On it stand four columns, one for each
library that computes on those arrays: go-numerics, go-statistics,
go-dataframe and go-plot. They carry the beam, go-notebook, where all of them
meet. Nothing is placed by hand: `mark/main.go` lists the member organisations
layer by layer, and the plates, cells, columns and spacing follow from that
list.

Its gradient (`#8FA3C8` to `#2F3E63`) is a slate blue that sets the umbrella
apart from every member: the emerald of go-ndarray, go-fft and go-notebook,
go-numerics' violet, go-statistics' amber, go-dataframe's magenta and
go-plot's blue. Its dark end reads on white at 10.55:1 and its light end on a
dark page at 7.58:1.

## Formats

- **SVG** — `svg/color`, `svg/white` (white, transparent), `svg/black` (black, transparent)
- **PNG** 16→1024 px, 3 variants — `png/<variant>/<size>/`
- **JPG** (color, white background) — `jpg/<size>/`
- **ICO** (Windows) — `ico/`
- **ICNS** (macOS) — `icns/`
- **GitHub avatar** 512 px — `avatar/`
- **Social preview** 1280×640 (repo banner) — `social/`

`check/kit.py` counts the whole matrix on every pull request, and the `mark`
job writes `svg/color/go-scikit.svg` again from `mark/main.go` and fails if
a byte differs.

```sh
cd mark && go run . > ../svg/color/go-scikit.svg
```

---
*`svg/color/go-scikit.svg` is written by `mark/main.go`; every other file is
generated from it by the fleet's Go brand pipeline (brandgen) — rounded square
badge, line glyph, color / white / black variants.*
Binary file added avatar/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions check/kit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env python3
"""Check that the brand kit is complete and well formed.

Every format the README promises must be there, at every size, and each file
must be what its path says: a PNG or JPG of that size, an ICO or ICNS by its
magic number, a 512-px avatar, a 1280x640 social preview. The white and black
SVG variants must carry no other colour. A kit once lived for a week with
three of its seven formats because every existing check looked at something
that was present; this counts the whole matrix instead.
"""
import os
import re
import struct
import sys

ORG = "go-scikit"
SIZES = [16, 32, 48, 64, 128, 256, 512, 1024]
errors = []


def need(path):
if not os.path.isfile(path):
errors.append(f"missing: {path}")
return None
with open(path, "rb") as f:
return f.read()


def png_size(b):
if b[:8] != b"\x89PNG\r\n\x1a\n":
return None
return struct.unpack(">II", b[16:24])


def jpg_size(b):
if b[:2] != b"\xff\xd8":
return None
i = 2
while i < len(b) - 9:
if b[i] != 0xFF:
i += 1
continue
marker = b[i + 1]
if marker in (0xC0, 0xC1, 0xC2):
h, w = struct.unpack(">HH", b[i + 5:i + 9])
return (w, h)
i += 2 + struct.unpack(">H", b[i + 2:i + 4])[0]
return None


def expect_size(path, got, want):
if got is None:
errors.append(f"not a valid image: {path}")
elif tuple(got) != tuple(want):
errors.append(f"{path}: {got[0]}x{got[1]}, want {want[0]}x{want[1]}")


for variant in ("color", "white", "black"):
svg = need(f"svg/{variant}/{ORG}.svg")
if svg is not None and variant != "color":
mono = "#FFFFFF" if variant == "white" else "#000000"
others = {c.upper() for c in re.findall(rb"#[0-9A-Fa-f]{6}", svg)} - {mono.encode()}
if others:
errors.append(f"svg/{variant}/{ORG}.svg carries other colours: {sorted(others)}")
for s in SIZES:
b = need(f"png/{variant}/{s}/{ORG}.png")
if b is not None:
expect_size(f"png/{variant}/{s}/{ORG}.png", png_size(b), (s, s))
for s in SIZES:
b = need(f"jpg/{s}/{ORG}.jpg")
if b is not None:
expect_size(f"jpg/{s}/{ORG}.jpg", jpg_size(b), (s, s))
b = need(f"avatar/{ORG}.png")
if b is not None:
expect_size(f"avatar/{ORG}.png", png_size(b), (512, 512))
b = need(f"social/{ORG}.png")
if b is not None:
expect_size(f"social/{ORG}.png", png_size(b), (1280, 640))
b = need(f"ico/{ORG}.ico")
if b is not None and b[:4] != b"\x00\x00\x01\x00":
errors.append(f"ico/{ORG}.ico is not an ICO file")
b = need(f"icns/{ORG}.icns")
if b is not None and b[:4] != b"icns":
errors.append(f"icns/{ORG}.icns is not an ICNS file")

if errors:
print("\n".join(errors))
sys.exit(1)
print(f"brand kit complete: 3 SVG, {3 * len(SIZES)} PNG, {len(SIZES)} JPG, avatar, social, ICO, ICNS")
Binary file added icns/go-scikit.icns
Binary file not shown.
Binary file added ico/go-scikit.ico
Binary file not shown.
Binary file added jpg/1024/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/128/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/16/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/256/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/32/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/48/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/512/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpg/64/go-scikit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions mark/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/go-scikit/brand/mark

go 1.27.2
117 changes: 117 additions & 0 deletions mark/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Command mark writes the go-scikit mark, svg/color/go-scikit.svg:
//
// cd mark && go run . > ../svg/color/go-scikit.svg
//
// go-scikit is the umbrella over seven organisations, and the mark is their
// stack drawn as a building: a base, the columns standing on it, and the
// beam they carry.
//
// - the base is the arrays: go-ndarray and go-fft, one plate cut in two;
// - the columns are the libraries that compute on those arrays:
// go-numerics, go-statistics, go-dataframe and go-plot, one column each;
// - the beam is go-notebook, the one place where all of them meet.
//
// Nothing is placed by hand. The layers below list the member organisations,
// and the geometry follows from them: a plate is cut into as many cells as its
// layer has members, the columns are spaced evenly across the width, and the
// vertical spacing leaves the same clear gap between the strokes of every two
// layers. Add a member to a layer and the mark redraws itself.
//
// The rest is the family grammar every go-* mark shares: a 256-unit rounded
// square (rx 56) filled with a diagonal two-stop gradient, a white line glyph
// at stroke-width 13 with round caps and joins. logos/brandgen renders the
// format matrix from the file this writes; the kit workflow runs this again
// and fails if a byte of svg/color differs.
package main

import (
"fmt"
"math"
"os"
"strings"
)

const (
light = "#8FA3C8" // the gradient's light stop
dark = "#2F3E63" // its dark stop

stroke = 13.0 // the family's line width

left, right = 48.0, 208.0 // the glyph's horizontal extent (stroke centres)
plate = 30.0 // height of a plate, between stroke centres
gap = 12.0 // clear space between the strokes of two layers
radius = 8.0 // corner radius of a plate
)

// layer is one level of the stack, bottom first.
type layer struct {
members []string
columns bool // drawn as columns rather than as a plate
}

var stack = []layer{
{members: []string{"go-ndarray", "go-fft"}},
{members: []string{"go-numerics", "go-statistics", "go-dataframe", "go-plot"}, columns: true},
{members: []string{"go-notebook"}},
}

// num prints a coordinate with at most one decimal and no trailing zero.
func num(v float64) string {
s := fmt.Sprintf("%.1f", math.Round(v*10)/10)
s = strings.TrimSuffix(s, ".0")
if s == "-0" {
s = "0"
}
return s
}

func main() {
// A column is half as tall again as a plate. The layers, strokes
// included, are centred on the square.
column := 1.5 * plate
total := 0.0
for _, l := range stack {
if l.columns {
total += column
} else {
total += plate
}
}
total += float64(len(stack)-1) * (gap + stroke)

var paths []string
// Bottom layer first: y grows downwards, so start at the bottom edge.
y := 128 + total/2
for _, l := range stack {
n := float64(len(l.members))
if l.columns {
// A line's round caps reach stroke/2 past its ends, exactly as a
// plate's stroke reaches stroke/2 past its edge, so the same
// spacing leaves the same clear gap.
top, bottom := y-column, y
for i := range l.members {
x := left + (right-left)*(float64(i)+0.5)/n
paths = append(paths, fmt.Sprintf(`<path d="M%s %sV%s"/>`, num(x), num(top), num(bottom)))
}
y -= column + gap + stroke
continue
}
top := y - plate
paths = append(paths, fmt.Sprintf(`<rect x="%s" y="%s" width="%s" height="%s" rx="%s"/>`,
num(left), num(top), num(right-left), num(plate), num(radius)))
for i := 1; i < len(l.members); i++ {
x := left + (right-left)*float64(i)/n
paths = append(paths, fmt.Sprintf(`<path d="M%s %sV%s"/>`, num(x), num(top), num(y)))
}
y -= plate + gap + stroke
}

fmt.Fprintf(os.Stdout, `<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="go-scikit">
<defs><linearGradient id="skgrad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="%s"/><stop offset="1" stop-color="%s"/></linearGradient></defs>
<rect width="256" height="256" rx="56" fill="url(#skgrad)"/>
<g fill="none" stroke="#FFFFFF" stroke-width="%s" stroke-linecap="round" stroke-linejoin="round">
%s
</g>
</svg>
`, light, dark, num(stroke), strings.Join(paths, "\n "))
}
Binary file added png/black/1024/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/128/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/16/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/256/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/32/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/48/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/512/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/black/64/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/1024/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/128/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/16/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/256/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/32/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/48/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/512/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/color/64/go-scikit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added png/white/1024/go-scikit.png
Binary file added png/white/128/go-scikit.png
Binary file added png/white/16/go-scikit.png
Binary file added png/white/256/go-scikit.png
Binary file added png/white/32/go-scikit.png
Binary file added png/white/48/go-scikit.png
Binary file added png/white/512/go-scikit.png
Binary file added png/white/64/go-scikit.png
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>go-scikit/.github"]
}
Binary file added social/go-scikit.png
11 changes: 11 additions & 0 deletions svg/black/go-scikit.svg
13 changes: 13 additions & 0 deletions svg/color/go-scikit.svg
11 changes: 11 additions & 0 deletions svg/white/go-scikit.svg
Loading