Skip to content

Instantly share code, notes, and snippets.

@jerlendds
Last active July 19, 2021 23:29
Show Gist options
  • Save jerlendds/8801cdcfce6d64397716a87473785a5a to your computer and use it in GitHub Desktop.
Save jerlendds/8801cdcfce6d64397716a87473785a5a to your computer and use it in GitHub Desktop.
from dataclasses import dataclass
@dataclass
class HexCode(str):
hex: str
def rgb(self):
hex_string = self.hex.lstrip('#')
lv = len(hex_string)
return tuple(int(hex_string[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
class NordColors:
"""
https://www.nordtheme.com/docs/colors-and-palettes
"""
def __init__(self):
# Polar Night - commonly used for base elements like backgrounds or text color in bright ambiance designs
self.nord0 = HexCode("#2e3440") # used for background and area coloring while it's not used for syntax highlighting
self.nord1 = HexCode("#3b4252") # used for elevated, more prominent or focused UI elements
self.nord2 = HexCode("#434c5e") # used for the currently active editor line as well as selection and text highlighting color
self.nord3 = HexCode("#4c566a") # used for UI elements like indent- and wrap guide marker
# Snow Storm - commonly used for text colors or base UI elements in bright ambiance designs
self.nord4 = HexCode("#d8dee9") # used for UI elements like the text editor caret
self.nord5 = HexCode("#e5e9f0") # used for more subtle UI text elements that do not need so much visual attention
self.nord6 = HexCode("#eceff4") # used for elevated UI text elements that require more visual attention
# Frost - commonly used for primary UI component and text highlighting and essential code syntax elements
self.nord7 = HexCode("#8fbcbb") # Used for UI elements that should, next to the primary accent color nord8, stand out
self.nord8 = HexCode("#88c0d0") # Used for primary UI elements that require the most visual attention
self.nord9 = HexCode("#81a1c1") # Used for secondary UI elements that also require more visual attention than other elements
self.nord10 = HexCode("#5e81ac") # tertiary UI elements that require more visual attention than default elements
# Aurora
self.nord11 = HexCode("#bf616a") # Used for UI elements that are rendering error states
self.nord12 = HexCode("#d08770") # indicate a more advanced or dangerous functionality
self.nord13 = HexCode("#ebcb8b") # Used for UI elements that are rendering warning states
self.nord14 = HexCode("#a3be8c") # Used for UI elements that are rendering success states
self.nord15 = HexCode("#b48ead") # may indicate a more uncommon functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment