Monochromator
Ein Theme für VS Code, Zed, Helix und Neovim. Die Schrift trägt die Struktur, Farbe gibt es nur für Literale. A theme for VS Code, Zed, Helix and Neovim. The type carries the structure, color is only for literals.
68.494Downloads
5,0 aus 6 Bewertungen from 6 reviews
16Themes
Die Idee The idea
Monochromator ist ein Theme für VS Code, Zed, Helix und Neovim und zugleich eine einfache Kritik an herkömmlichen Themes, die mit Farbe um sich schmeißen. Denn wenn alles farblich hervorgehoben ist, ist nichts hervorgehoben. Deshalb trägt bei Monochromator die Schrift die Struktur: fett, kursiv, unterstrichen, gedimmt. Die eine Akzentfarbe ist den Literalen vorbehalten, den eigentlichen Daten im Code. So bleibt Farbe selten und wird wieder zum Signal. Das Ziel ist ein ruhiger Editor, der die Aufmerksamkeit beim Code lässt. Dafür reichen neun Regeln, die man sich gut merken kann. Monochromator is a theme for VS Code, Zed, Helix and Neovim, and at the same time a simple critique of conventional themes that throw color around. Because when everything is highlighted in color, nothing is highlighted. That is why in Monochromator the type carries the structure: bold, italic, underlined, dimmed. The single accent color is reserved for literals, the actual data in the code. So color stays rare and becomes a signal again. The goal is a calm editor that keeps your attention on the code. All it takes is nine rules you can easily remember.
Farbfiasko Color circus
Derselbe Code zweimal. Links ein Theme, das jeder Kategorie eine eigene Farbe gibt, dazu bunte Klammern und Einrückungsstreifen. Rechts Monochromator. Zieh den Regler. The same code twice. On the left, a theme that gives every category its own color, plus colored brackets and indent stripes. On the right, Monochromator. Drag the slider.
#include <algorithm>
#include <string>
#include <string_view>
#include <vector>
namespace ntg {
// A hit in the apparatus: position plus reading.
struct Hit {
std::size_t pos;
std::string reading;
};
template <typename Pred>
std::vector<Hit> collect(std::string_view text, Pred keep) {
std::vector<Hit> hits;
for (std::size_t i = 0; i < text.size(); ++i) {
if (keep(text[i])) {
hits.push_back({i, std::string{text[i]}});
}
}
return hits;
}
constexpr auto is_sigla = [](char c) { return c == '*' || c == '#'; };
std::size_t count_sigla(std::string_view text) {
auto hits = collect(text, is_sigla);
std::sort(hits.begin(), hits.end(),
[](const Hit& a, const Hit& b) { return a.pos < b.pos; });
return hits.size();
}
} // namespace ntg
12Farben für Codecolors for code
1Farbe, dazu 3 Grautönecolor, plus 3 grays
Neun Regeln Nine rules
// Palette bundles the color values of a single mode (dark/light).
type Palette struct {
BG string `json:"bg"`
FG string `json:"fg"`
Accent string `json:"accent"`
}
// Pick returns the dark or light value depending on the mode.
func Pick(mode, dark, light string) string {
if mode == "dark" {
return dark
}
return light
}
func (p Palette) Color(name string) (string, error) {
switch name {
case "blue":
return p.Blue, nil
case "magenta":
return p.Magenta, nil
default:
return "", fmt.Errorf("unknown color %q", name)
}
}
func Load(dir string) (*Config, error) {
data, err := os.ReadFile(filepath.Join(dir, "base.json"))
if err != nil {
return nil, fmt.Errorf("loading base palette: %w", err)
}
var palettes map[string]Palette
if err := json.Unmarshal(data, &palettes); err != nil {
return nil, fmt.Errorf("parsing base palette: %w", err)
}
return &Config{Palettes: palettes}, nil
}#[derive(Debug, Clone, PartialEq)]
pub struct Token {
pub text: String,
pub pos: usize,
}
/// A lexer over the beta-code apparatus.
pub struct Lexer<'a> {
input: &'a str,
pos: usize,
}
impl<'a> Lexer<'a> {
pub fn new(input: &'a str) -> Self {
Self { input, pos: 0 }
}
/// Converts a beta-code letter with its diacritics into Unicode.
pub fn convert(&mut self, c: char) -> Result<char, ParseError> {
self.pos += 1;
match c {
'a'..='z' => Ok(BASE[(c as u8 - b'a') as usize]),
')' => Ok('\u{0313}'),
'(' => Ok('\u{0314}'),
_ => Err(ParseError::new(
self.pos,
format!("unknown character {c:?}"),
)),
}
}
pub fn words(&self) -> impl Iterator<Item = &str> + '_ {
self.input.split_whitespace().filter(|w| !w.is_empty())
}
}type Mode = "dark" | "light"
interface Verse {
v: number
t: string
}
interface Chapter {
book: string
vs: Verse[]
}
const CACHE = new Map<string, Chapter>()
/**
* Loads a chapter from the static data store.
* @param ref Canonical reference, e.g. "MT/5"
*/
export async function loadChapter(ref: string): Promise<Chapter | null> {
const cached = CACHE.get(ref)
if (cached !== undefined) return cached
const res = await fetch(`/data/ntg/text/${ref}.json`)
if (!res.ok) return null
const data: Chapter = await res.json()
CACHE.set(ref, data)
return data
}
export function wordCount(ch: Chapter): number {
return ch.vs
.filter((verse) => verse.t !== "")
.reduce((sum, verse) => sum + verse.t.split(/\s+/).length, 0)
}#include <errno.h>
#include <stdio.h>
#include <string.h>
#define KEY_LEN 32
enum key_state { KEY_EMPTY = 0, KEY_LOADED, KEY_WIPED };
struct key {
unsigned char bytes[KEY_LEN];
enum key_state state;
};
int read_key(struct key *k, FILE *fp);
/* Zeroes the buffer before key material is released. */
static void bzero_explicit(unsigned char *buf, size_t len) {
volatile unsigned char *p = buf;
while (len--)
*p++ = 0;
}
int main(void) {
struct key k = { .state = KEY_EMPTY };
if (read_key(&k, stdin) != 0) {
fprintf(stderr, "no key: %s\n", strerror(errno));
return 1;
}
printf("loaded: %d bytes\n", KEY_LEN);
bzero_explicit(k.bytes, sizeof k.bytes);
k.state = KEY_WIPED;
return 0;
}#include <algorithm>
#include <string>
#include <string_view>
#include <vector>
namespace ntg {
// A hit in the apparatus: position plus reading.
struct Hit {
std::size_t pos;
std::string reading;
};
template <typename Pred>
std::vector<Hit> collect(std::string_view text, Pred keep) {
std::vector<Hit> hits;
for (std::size_t i = 0; i < text.size(); ++i) {
if (keep(text[i])) {
hits.push_back({i, std::string{text[i]}});
}
}
return hits;
}
constexpr auto is_sigla = [](char c) { return c == '*' || c == '#'; };
std::size_t count_sigla(std::string_view text) {
auto hits = collect(text, is_sigla);
std::sort(hits.begin(), hits.end(),
[](const Hit& a, const Hit& b) { return a.pos < b.pos; });
return hits.size();
}
} // namespace ntgpackage at.beem.ntg;
import java.util.List;
import java.util.Objects;
/** A witness to the text: a manuscript siglum with its readings. */
public final class Witness {
private static final String UNKNOWN = "\u2014";
private final String siglum;
private final List<String> readings;
/**
* Creates a witness.
*
* @param siglum the manuscript siglum, for example "P46"
*/
public Witness(String siglum, List<String> readings) {
this.siglum = Objects.requireNonNull(siglum);
this.readings = List.copyOf(readings);
}
public String readingAt(int index) {
if (index < 0 || index >= readings.size()) {
return UNKNOWN;
}
return readings.get(index);
}
@Override
public String toString() {
return siglum + ": " + readings.size() + " readings";
}
}# Monochromator
Distraction-free **monochrome** theme for VS Code, Zed, Helix and Neovim.
## Installation
1. Open the Extensions view (`Ctrl+Shift+X`)
2. Search for *Monochromator*
3. Or install directly via [Open VSX](https://open-vsx.org/extension/beem/monochromator)
> For 100 % correct behavior, set `editor.bracketPairColorization.enabled`
> to `false`.
## Variants
| Variant | Accent |
|---------|--------|
| Default | Blue |
| Ruby | Red |
Use \* to write a literal asterisk, ~~struck~~ works too.% Minimal article: one lemma, one equation.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{lemma}{Lemma}
\title{On the Grating Equation}
\author{J. Beem}
\begin{document}
\maketitle
\section{Setup}
The wavelength follows from $m\lambda = d\sin\theta_m$, where $m$
is the diffraction order.
\begin{lemma}
For the sodium D line, $\lambda = 589.3\,\mathrm{nm}$.
\end{lemma}
\begin{equation}
E = h\nu = \frac{hc}{\lambda}
\end{equation}
\end{document}Palette
Monochromator Mono
Die passende Schrift zum Theme. Ihr Fett ist schwerer und ihre Kursive weicht stärker von der Aufrechten ab als bei den meisten Code-Schriften. The matching font for the theme. Its bold is heavier and its italic differs more from the upright than in most code fonts.
RegularBezeichner, Literale, Zeichen-OperatorenIdentifiers, literals, symbol operators
BoldSchlüsselwörter, Wort-OperatorenKeywords, word operators
ItalicFunktionen, KommentareFunctions, comments
Bold ItalicDoku-Tags, ShebangDoc tags, shebang
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789 ( ) { } [ ] < > = + * / ; : & | ! ?
one of the best (and my personal favorite) monochromatic theme (collection) for vscode. thanks :)
Dark Amber is really good.
cool theme thx for publishing on vs marketplace
Best theme ever, good work!