d2themes

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MPL-2.0 Imports: 0 Imported by: 10

README

d2themes

d2themes defines themes for D2. You can add a new one in ./d2themescatalog, give a unique ID, and specify it in the CLI or library to see it.

For example, to use the "Shirley temple" theme, which has an ID of 102:

d2 --theme 102 in.d2 out.svg

Run d2 --help or man d2 for more.

Themes overview

Color coding guide

Color coding example

Container gradients

To distinguish container nesting, objects get progressively lighter the more nested it is.

Documentation

Overview

d2themes defines themes to make d2 diagrams pretty Color codes: darkest (N1) -> lightest (N7)

Index

Constants

This section is empty.

Variables

View Source
var CoolNeutral = Neutral{
	N1: "#0A0F25",
	N2: "#676C7E",
	N3: "#9499AB",
	N4: "#CFD2DD",
	N5: "#DEE1EB",
	N6: "#EEF1F8",
	N7: "#FFFFFF",
}
View Source
var WarmNeutral = Neutral{
	N1: "#170206",
	N2: "#535152",
	N3: "#787777",
	N4: "#CCCACA",
	N5: "#DFDCDC",
	N6: "#ECEBEB",
	N7: "#FFFFFF",
}

Functions

This section is empty.

Types

type ColorPalette

type ColorPalette struct {
	Neutrals Neutral `json:"neutrals"`

	// Base Colors: used for containers
	B1 string `json:"b1"`
	B2 string `json:"b2"`
	B3 string `json:"b3"`
	B4 string `json:"b4"`
	B5 string `json:"b5"`
	B6 string `json:"b6"`

	// Alternative colors A
	AA2 string `json:"aa2"`
	AA4 string `json:"aa4"`
	AA5 string `json:"aa5"`

	// Alternative colors B
	AB4 string `json:"ab4"`
	AB5 string `json:"ab5"`
}

type Neutral

type Neutral struct {
	N1 string `json:"n1"`
	N2 string `json:"n2"`
	N3 string `json:"n3"`
	N4 string `json:"n4"`
	N5 string `json:"n5"`
	N6 string `json:"n6"`
	N7 string `json:"n7"`
}

type Theme

type Theme struct {
	ID     int64        `json:"id"`
	Name   string       `json:"name"`
	Colors ColorPalette `json:"colors"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL