|
| 1 | +## GapStyle Specification |
| 2 | + |
| 3 | +GapStyle is designed base on some key color of 'Darcula' and 'Monokai' theme. |
| 4 | + |
| 5 | +GapStyle is a **_productivity-oriented_** and **_semantic-highlight-optimized_** designed |
| 6 | +color scheme with a [list of supported languages](#actively-maintain-language). Each |
| 7 | +supported language is tailor made and carefully tuned with |
| 8 | +[rationale](#gapstyle-specification). |
| 9 | + |
| 10 | +The first draft of GapStyle was created on 2014 in PhpStorm 8. After that, Gap have spent |
| 11 | +10,000+ hours of using GapStyle scheme and at least 500+ hours of A/B testing, tuning and |
| 12 | +stablizing throughout the years. |
| 13 | + |
| 14 | +So, GapStyle is a unique and opinionated color scheme that has converged |
| 15 | +[Gap's 5+ years of software development experience](https://github.com/gaplotech/bio) |
| 16 | +(learning, reading and writing on various programming languages) into |
| 17 | +productivity-oriented syntax hightlight GapStyle specification. |
| 18 | + |
| 19 | +### Semantic Highlighting Optimized |
| 20 | + |
| 21 | +#### Why we need highlighting? |
| 22 | + |
| 23 | +When trying to understand what the code does, we usually first try to recognize its coarse |
| 24 | +structure. For that, we need a fast overview of the code. With that overview, we can |
| 25 | +decide where we want to continue concentrating on. Now the problem is, while building this |
| 26 | +overview, really many words have to be scanned. Actually reading all of them would take a |
| 27 | +long time, and would be very annoying. **Highlighting specific words in deterministic |
| 28 | +colors helps us to reduce that load**, by giving us familiar orientation points and |
| 29 | +patterns that our eyes can “hook” on, and allows us finding the specific position we’re |
| 30 | +searching faster. |
| 31 | + |
| 32 | +So syntax highlighting helps us to keep an overview or finding the place we’re searching |
| 33 | +for. However, it cannot help us actually understanding the code, because by the pure |
| 34 | +definition of “syntax”, it can only highlight by what the code looks like, not by what the |
| 35 | +code means, since that requires wider knowledge. |
| 36 | + |
| 37 | +#### Semantic Highlighting |
| 38 | + |
| 39 | +Semantic Highlighting to overcome that limitation, deeper knowledge of the code is |
| 40 | +required. Semantic highlighting is an extension of syntax highlighting. |
| 41 | + |
| 42 | +Different language has different richness of the semantic highlight implementation. Thus, |
| 43 | +general designed theme without dedicate tuning for each language don't utilize semantic |
| 44 | +highlighting well. |
| 45 | + |
| 46 | +In contrast, GapStyle is giving different semantic a unique distinct colors and font |
| 47 | +style. Here is the result : |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +From my experience, GapStyle helps to improve my reading and writing code speed by: |
| 52 | + |
| 53 | +- 30% when working on my own project |
| 54 | + |
| 55 | +- 50% when studying other's source code and new languages |
| 56 | + |
| 57 | +### Recommended Font |
| 58 | + |
| 59 | +| Font | Platform | Ligature | Description | Action | |
| 60 | +| ---------------------------------------------------------------- | -------- | :------: | -------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------: | |
| 61 | +| [Hack JBM Ligatured](https://github.com/gaplo917/Ligatured-Hack) | IntelliJ | ✅ | Hack font with [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono) ligature, built by Gap | [Download](https://github.com/gaplo917/Ligatured-Hack/releases) | |
| 62 | +| [Hack FC Ligatured](https://github.com/gaplo917/Ligatured-Hack) | IntelliJ | ✅ | Hack font with [FIRA Code](https://github.com/tonsky/FiraCode) ligature, built by Gap | [Download](https://github.com/gaplo917/Ligatured-Hack/releases) | |
| 63 | +| [Hack](https://github.com/source-foundry/Hack) | IntelliJ | - | Standard Hack font | [Download](https://github.com/source-foundry/Hack/releases) | |
| 64 | +| [Meslo LG DZ](https://github.com/andreberg/Meslo-Font) | Xcode | - | Solve Xcode no line-spacing settings | [Download](https://github.com/andreberg/Meslo-Font/releases) | |
| 65 | + |
| 66 | +### Color Palette |
| 67 | + |
| 68 | +| Syntax | Theme | Color | Philosophy | |
| 69 | +| ----------------------- | ------------------------------- | :-----------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 70 | +| Default | Darcula |  | Monokai's default pure white color is too high contrast | |
| 71 | +| Keyword | Monokai |  | | |
| 72 | +| String | Monokai |  | | |
| 73 | +| Number | Monokai |  | | |
| 74 | +| Class, Struct | Monokai |  | | |
| 75 | +| Abstract Class | Derived from **Class** |  | always affinitive to **Class**. Should be distinguished from **Class** but not too eye-catching. To remain overall harmony, just add slightly green on  | |
| 76 | +| Interface, Protocol | Derived from **Abstract Class** |  | should be distinguished easily from **Class/Abstract Class** but also should keep 'claim' with them. Add more green on  | |
| 77 | +| Method | Monokai |  | | |
| 78 | +| Parameter | Darcula |  | | |
| 79 | +| Local variable | Derived from **Parameter** |  | always affinitive to **Parameter**. Should be distinguished from **Parameter** but not too eye-catching. To remain overall harmony, just substract some orange on  | |
| 80 | +| Annotation | Darcula |  | | |
| 81 | +| Comment | Darcula |  | | |
| 82 | +| Doc | Darcula |  | should be distinguished from **Comment** and **String** | |
| 83 | +| Enum, Constant | Custom |  | should be distinguished easily from **Parameter**, **Local variable**, **String**, **Number** | |
| 84 | +| Typealias, Generic Type | Custom |  | should be distinguished easily from **Interface/Class/Abstract Class** | |
| 85 | + |
| 86 | +### Special Styling |
| 87 | + |
| 88 | +| Syntax | Style | Philosophy | |
| 89 | +| ---------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | |
| 90 | +| Keyword | **Bold** | Bold to standout and outweight the importance | |
| 91 | +| Singleton | **Bold** | preserve same color but also should be distinguished easily from non-singleton object | |
| 92 | +| Global/Static variable | **_Italic + Bold_** | preserve same color but also should be distinguished easily from **Parameter** and **Local variable** | |
| 93 | +| Smart cast |  (background color) | should be distinguishable easily | |
| 94 | +| Invalid Expression |  (underwaved line) | Inherited from Darcula | |
| 95 | +| Reassigned Variable | underscored | Inherited from Darcula | |
| 96 | + |
| 97 | +### Special File Type |
| 98 | + |
| 99 | +| File | Theme | Philosophy | |
| 100 | +| ---- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 101 | +| XML | Darcula | NOT to use HTML-like highlighting because IntelliJ use XML color scheme to highlight JSX's tags internally. Using Darcula original color can prevent from having too much Monokai's **Keyword** color | |
| 102 | +| JSON | Derived from **JavaScript** | **Property Key** color should align with **JavaScript** Object | |
0 commit comments