Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Doomの派生テーマを作る
Search
grugrut
July 24, 2019
Programming
960
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Doomの派生テーマを作る
grugrut
July 24, 2019
More Decks by grugrut
See All by grugrut
Chromebook on Emacs
grugrut
0
590
MELPAランキング in 2019
grugrut
2
750
Emacs on WSLでの困りごと
grugrut
1
7.9k
Other Decks in Programming
See All in Programming
新卒PdEのリアル
ryu1013
1
510
wkhtmltopdfの次どうするか問題2026
willnet
2
1.7k
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
210
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
490
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
280
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
スマート反転とウェブアクセシビリティ
camiha
0
210
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
570
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.2k
Security issues being discussed on Web Platforms
petamoriken
0
1.2k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
100
Building an Out-of-Order CPU
latte72
1
800
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
First, design no harm
axbom
PRO
2
1.3k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
It's Worth the Effort
3n
188
29k
Designing Experiences People Love
moore
143
24k
The SEO Collaboration Effect
kristinabergwall1
1
570
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
240
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing for humans not robots
tammielis
254
26k
Optimizing for Happiness
mojombo
378
71k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
Transcript
Doomの派生テーマを作る 2019.07.24 Emacs七夕まつり @grugrut
@grugrut/Masanori Mano 都内SIer勤務 昔はeclipseのプラグイン書く仕事、今はyamlを書く仕事をしてます といいつつ、パワポとExcelばっかり使ってたり。。。 org-modeでメモとったり、日曜プログラミングでは大活躍 みなさん好きなテーマはありますか? solarized? dracula? zenburn?
私が好きなテーマは、もちろん manoj-dark です
manoj-dark Emacsにはじめから入っているテーマ Manoj Srivastava氏が作成。 コメントによると • ライトテーマってずっと見てると目が疲れるよね • コントラスト上げたいけどごちゃごちゃするの嫌よね •
色系列で彩度をかえずに色をかえてるから見やすいよ というのがウリ 自分はコントラスト高いのが好みなので使ってた https://pawelbx.github.io/emacs-theme-gallery/
doom-modeline / doom-theme モードラインのカスタマイズも沼 powerline → smart-modeline → spacelineと渡り歩き今はdoom-modeline all-the-iconsとの相性がよい。spaceline-all-the-icons結構つらかった。
同じ名前でひかれたdoom-theme visual bellをモードライン点滅にできたりして便利 ※実はdoom-themeとdoom-modelineは無関係 ただ、doom-themeのテーマにmanoj-darkっぽいのない。薄味なものが多い。 doom-one使ってたけど、もっとハイコントラストなものが欲しい
作ればいいじゃん
作りました
def-doom-themeで実装 (def-doom-theme doom-manoj-dark "A dark theme from Manoj for doom-theme"
;; name gui 256 16 ((bg '("#000000" nil nil)) (bg-alt '("#4d4d4d" nil nil)) (base0 '("#0000ff" nil nil)) (base1 '("#b4eeb4" nil nil)) (base2 '("#4d4d4d" nil nil)) (base3 '("#525252" nil nil)) (base4 '("#f5deb3" nil nil)) (base5 '("#b3b3b3" nil nil)) (base6 '("#b3b3b3" nil nil)) (base7 '("#98fb98" nil nil)) (base8 '("#ff7f24" nil nil)) (fg '("#f5f5f5" nil nil)) (fg-alt '("#cccccc" nil nil)) (red '("#ff0000" nil nil)) (grey '("#a9a9a9" nil nil)) (dark-blue '("#00008b" nil nil)) (green '("#00ff00" nil nil)) (blue '("#0000ff" nil nil)) (violet '("#ee82ee" nil nil)) (magenta '("#ff00ff" nil nil)) (yellow '("#ffff00" nil nil)) (orange '("#ff4500" nil nil)) (cyan '("#00ffff" nil nil)) (teal '("#98fb98" nil nil)) (dark-cyan '("#008b8b" nil nil)) ;; face categories (region '("#0000cd" nil nil)) (highlight '("#fdf5e6" nil nil)) (vertical-bar '("#696969" nil nil)) (error '("#ff4500" nil nil)) (warning '("#ffa500" nil nil)) (builtin '("#b0c4de" nil nil)) (comments '("#ff7f24" nil nil)) (doc-comments '("#f08080" nil nil)) (constants '("#8470ff" nil nil)) (functions '("#00fa9a" nil nil)) (keywords '("#00ffff" nil nil)) (strings '("#ffc1c1" nil nil)) (type '("#63b8ff" nil nil)) (variables '("#7fffd4" nil nil)) (operators '("#6495ed" nil nil)) (selection '("#0000ff" nil nil)) (vc-modified '("#f0e68c" nil nil)) (vc-added '("#00ff00" nil nil)) (vc-deleted '("#ff8c69" nil nil)) (methods '("#00fa9a" nil nil)) (numbers '("#ffa07a" nil nil)) ) ;; extra faces ((font-lock-constant-face :foreground constants :bold t) (cursor :background "#da70d6") (mode-line :background "#bfbfbf" :foreground blue) (doom-modeline-buffer-file :foreground "#ff0000" :weight 'bold) (doom-modeline-project-dir :foreground magenta) (doom-modeline-bar :background blue) (magit-section-heading :foreground "LightGoldenrod2" :weight 'bold) (rainbow-delimiters-depth-1-face :foreground "grey55") (rainbow-delimiters-depth-2-face :foreground "#93a8c6") (rainbow-delimiters-depth-3-face :foreground "#b0b1a3") (rainbow-delimiters-depth-4-face :foreground "#97b098") (rainbow-delimiters-depth-5-face :foreground "#aebed8") (rainbow-delimiters-depth-6-face :foreground "#b0b0b3") (rainbow-delimiters-depth-7-face :foreground "#90a890") (rainbow-delimiters-depth-7-face :foreground "#a2b6da") (rainbow-delimiters-depth-7-face :foreground "#9cb6ad") ) ;; --- extra variables -------------------- ;; () ) ↗ ↗ ↗ ↗ ※1列で書ききれないので3列に分割
def-doom-themeで実装 (def-doom-theme doom-manoj-dark "A dark theme from Manoj for doom-theme"
;; name gui 256 16 ((bg '("#000000" nil nil)) (bg-alt '("#4d4d4d" nil nil)) (base0 '("#0000ff" nil nil)) (base1 '("#b4eeb4" nil nil)) (base2 '("#4d4d4d" nil nil)) (base3 '("#525252" nil nil)) (base4 '("#f5deb3" nil nil)) (base5 '("#b3b3b3" nil nil)) (base6 '("#b3b3b3" nil nil)) (base7 '("#98fb98" nil nil)) (base8 '("#ff7f24" nil nil)) (fg '("#f5f5f5" nil nil)) (fg-alt '("#cccccc" nil nil)) (red '("#ff0000" nil nil)) (grey '("#a9a9a9" nil nil)) (dark-blue '("#00008b" nil nil)) (green '("#00ff00" nil nil)) (blue '("#0000ff" nil nil)) (violet '("#ee82ee" nil nil)) (magenta '("#ff00ff" nil nil)) (yellow '("#ffff00" nil nil)) (orange '("#ff4500" nil nil)) (cyan '("#00ffff" nil nil)) (teal '("#98fb98" nil nil)) (dark-cyan '("#008b8b" nil nil)) ;; face categories (region '("#0000cd" nil nil)) (highlight '("#fdf5e6" nil nil)) (vertical-bar '("#696969" nil nil)) (error '("#ff4500" nil nil)) (warning '("#ffa500" nil nil)) (builtin '("#b0c4de" nil nil)) (comments '("#ff7f24" nil nil)) (doc-comments '("#f08080" nil nil)) (constants '("#8470ff" nil nil)) (functions '("#00fa9a" nil nil)) (keywords '("#00ffff" nil nil)) (strings '("#ffc1c1" nil nil)) (type '("#63b8ff" nil nil)) (variables '("#7fffd4" nil nil)) (operators '("#6495ed" nil nil)) (selection '("#0000ff" nil nil)) (vc-modified '("#f0e68c" nil nil)) (vc-added '("#00ff00" nil nil)) (vc-deleted '("#ff8c69" nil nil)) (methods '("#00fa9a" nil nil)) (numbers '("#ffa07a" nil nil)) ) ;; extra faces ((font-lock-constant-face :foreground constants :bold t) (cursor :background "#da70d6") (mode-line :background "#bfbfbf" :foreground blue) (doom-modeline-buffer-file :foreground "#ff0000" :weight 'bold) (doom-modeline-project-dir :foreground magenta) (doom-modeline-bar :background blue) (magit-section-heading :foreground "LightGoldenrod2" :weight 'bold) (rainbow-delimiters-depth-1-face :foreground "grey55") (rainbow-delimiters-depth-2-face :foreground "#93a8c6") (rainbow-delimiters-depth-3-face :foreground "#b0b1a3") (rainbow-delimiters-depth-4-face :foreground "#97b098") (rainbow-delimiters-depth-5-face :foreground "#aebed8") (rainbow-delimiters-depth-6-face :foreground "#b0b0b3") (rainbow-delimiters-depth-7-face :foreground "#90a890") (rainbow-delimiters-depth-7-face :foreground "#a2b6da") (rainbow-delimiters-depth-7-face :foreground "#9cb6ad") ) ;; --- extra variables -------------------- ;; () ) ↗ ↗ ↗ ↗ TrueColor, 256, 16 terminalで使う色を 指定 基本となる色を定義 ソースコード用face の定義 ここまで必須項目 ※doomのウリがソースを 見やすいテーマなので 追加で指定もできる custom-theme-set-facesを呼ぶ 他の見るとほぼ使われてない custom-theme-set-variablesを呼ぶ 配布するテーマで設定するケースは あまりなさそう(フォントまで指定しちゃう?)
doom-themeの便利な仕様・機能
その1 必須項目だけ設定すれば、それなりのものができる doom-theme-base.elで、かなりのfaceが定義されている 先に説明した必須の色定義を使っているので、必須項目を設定するだけで それなりに見えるものができる Face定義の読みこみ優先順位は以下のとおり ユーザの.emacs > 個別のテーマのextra faces
> doom-theme-base.el 私もとりあえず必須だけ設定、その後気になるところを上書きで進めています
その2 色に統一感もたせるための便利機能 (font-lock-constant-face :foreground constants :bold t) こんな感じで定義した色定義を利用できるだけでなく加工する関数もある • doom-blend
(color1, color2, alpha) ◦ color1, color2をalphaの割合で混ぜる • doom-lighten(color1, alpha) ◦ color1を明るくする(alphaの割合で#FFFFFFとdoom-blend) • doom-darken(color1, alpha) ◦ color1を暗くする(alphaの割合で#000000とdoom-blend) この関数を使うためには、色を#RRGGBBで書かないといけない 例: `chocolate1’ではなく`#FF7F24’と書くのが重要
テーマ作りで役にたった機能 M-x describe-face カーソル位置のfaceがわかる M-x list-face-display faceの一覧がわかる rainbow-mode 色がプレビューできる もちろんcss等書くときにも使える
難しかったところ • 今回は、manoj-darkを模すのが目的 ◦ ここってmanoj-darkどうだっけ。。。? ◦ ふたつemacs起動して見比べるの面倒 ◦ 作りかたが違うものなのでごそっとコピーしてもそんなにうまくいかない •
M-x describe-faceは確かに便利 ◦ 便利なんだけど、本当にどのfaceが使われてるか知りたいのってカーソルがあたらない ◦ helm-xxx-faceとか、magit-xxx-faceとか、どれ変えればいいんだ。。。!!
ぜひオリジナルテーマ作ってみましょう