Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Atom One Themes #41

Merged
merged 3 commits into from
May 2, 2024
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
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ The library comes with predefined syntax coloring themes available in `SyntaxThe
<th>Notepad</th>
<th>Matrix</th>
<th>Pastel</th>
<th>Atom One</th>
<tr>
<td>

Expand Down Expand Up @@ -157,6 +158,19 @@ The library comes with predefined syntax coloring themes available in `SyntaxThe
- ![#888A85](https://placehold.co/15x15/888A85/888A85.png) Multiline Comment
- ![#CB956D](https://placehold.co/15x15/CB956D/CB956D.png) Punctuation
- ![#CB956D](https://placehold.co/15x15/CB956D/CB956D.png) Mark
</td>
<td>

- ![#DFDEE0](https://placehold.co/15x15/BBBBBB/BBBBBB.png) Code
- ![#729FCF](https://placehold.co/15x15/D55FDE/D55FDE.png) Keyword
- ![#93CF55](https://placehold.co/15x15/89CA78/89CA78.png) String
- ![#8AE234](https://placehold.co/15x15/D19A66/D19A66.png) Literal
- ![#888A85](https://placehold.co/15x15/5C6370/5C6370.png) Comment
- ![#5DB895](https://placehold.co/15x15/E5C07B/E5C07B.png) Metadata
- ![#888A85](https://placehold.co/15x15/5C6370/5C6370.png) Multiline Comment
- ![#CB956D](https://placehold.co/15x15/EF596F/EF596F.png) Punctuation
- ![#CB956D](https://placehold.co/15x15/2BBAC5/2BBAC5.png) Mark

</td>
</tr>
</table>
Expand All @@ -169,6 +183,7 @@ The library comes with predefined syntax coloring themes available in `SyntaxThe
<th>Notepad</th>
<th>Matrix</th>
<th>Pastel</th>
<th>Atom One</th>
<tr>
<td>

Expand Down Expand Up @@ -229,6 +244,19 @@ The library comes with predefined syntax coloring themes available in `SyntaxThe
- ![#888A85](https://placehold.co/15x15/888A85/888A85.png) Multiline Comment
- ![#CB956D](https://placehold.co/15x15/CB956D/CB956D.png) Punctuation
- ![#CB956D](https://placehold.co/15x15/CB956D/CB956D.png) Mark
</td>
<td>

- ![#DFDEE0](https://placehold.co/15x15/383A42/383A42.png) Code
- ![#729FCF](https://placehold.co/15x15/A626A4/A626A4.png) Keyword
- ![#93CF55](https://placehold.co/15x15/50A14F/50A14F.png) String
- ![#8AE234](https://placehold.co/15x15/986801/986801.png) Literal
- ![#888A85](https://placehold.co/15x15/A1A1A1/A1A1A1.png) Comment
- ![#5DB895](https://placehold.co/15x15/C18401/C18401.png) Metadata
- ![#888A85](https://placehold.co/15x15/A1A1A1/A1A1A1.png) Multiline Comment
- ![#CB956D](https://placehold.co/15x15/E45649/E45649.png) Punctuation
- ![#CB956D](https://placehold.co/15x15/526FFF/526FFF.png) Mark

</td>
</tr>
</table>
Expand Down Expand Up @@ -265,9 +293,11 @@ If your project uses this code, please write me or add your info
</tr>
<tr>
<td>Application</td>
<td>
<a href="https://play.google.com/store/apps/details?id=pl.tkadziolka.snipbook">SnippLog</a>
</td>
<td> <a href="https://play.google.com/store/apps/details?id=pl.tkadziolka.snipbook">SnippLog</a> </td>
</tr>
<tr>
<td>Application</td>
<td> <a href="https://opensource.respawn.pro/FlowMVI/sample/">FlowMVI Sample</a> </td>
</tr>
</table>

Expand All @@ -289,7 +319,7 @@ Then make sure:
License 🖋️
=======

Copyright 2023 Tomasz Kądziołka.
Copyright 2023-2024 Tomasz Kądziołka.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ private const val MONOKAI_KEY = "monokai"
private const val NOTEPAD_KEY = "notepad"
private const val MATRIX_KEY = "matrix"
private const val PASTEL_KEY = "pastel"
private const val ATOM_ONE_KEY = "atomone"

object SyntaxThemes {

Expand Down Expand Up @@ -68,6 +69,18 @@ object SyntaxThemes {
multilineComment = 0x888A85,
punctuation = 0xCB956D,
mark = 0xCB956D
),
ATOM_ONE_KEY to SyntaxTheme(
key = ATOM_ONE_KEY,
code = 0xBBBBBB,
keyword = 0xD55FDE,
string = 0x89CA78,
literal = 0xD19A66,
comment = 0x5C6370,
metadata = 0xE5C07B,
multilineComment = 0x5C6370,
punctuation = 0xEF596F,
mark = 0x2BBAC5
)
)

Expand Down Expand Up @@ -131,7 +144,20 @@ object SyntaxThemes {
multilineComment = 0x888A85,
punctuation = 0xCB956D,
mark = 0xCB956D
),
ATOM_ONE_KEY to SyntaxTheme(
key = ATOM_ONE_KEY,
code = 0x383A42,
keyword = 0xA626A4,
string = 0x50A14F,
literal = 0x986801,
comment = 0xA1A1A1,
metadata = 0xC18401,
multilineComment = 0xA1A1A1,
punctuation = 0xE45649,
mark = 0x526FFF,
)

)

fun themes(darkMode: Boolean = false) = if (darkMode) dark else light
Expand All @@ -143,6 +169,7 @@ object SyntaxThemes {
fun notepad(darkMode: Boolean = false) = themes(darkMode)[NOTEPAD_KEY]!!
fun matrix(darkMode: Boolean = false) = themes(darkMode)[MATRIX_KEY]!!
fun pastel(darkMode: Boolean = false) = themes(darkMode)[PASTEL_KEY]!!
fun atom(darkMode: Boolean = false) = themes(darkMode)[ATOM_ONE_KEY]!!

fun getNames(): List<String> = SyntaxThemes.light.map {
it.key
Expand All @@ -151,4 +178,4 @@ object SyntaxThemes {
}

fun SyntaxTheme.useDark(darkMode: Boolean) = if (darkMode) dark[key] else light[key]
}
}