"""
Cobalt2 syntax highlighting style for Pygments.

Based on the Cobalt2 theme by Wes Bos:
https://github.com/wesbos/cobalt2-vscode
"""

from pygments.style import Style
from pygments.styles import STYLE_MAP
from pygments.token import (
    Comment,
    Error,
    Generic,
    Keyword,
    Literal,
    Name,
    Number,
    Operator,
    String,
    Text,
    Whitespace,
)


class Cobalt2Style(Style):
    """Cobalt2 theme for Pygments syntax highlighting."""

    name = "cobalt2"

    background_color = "#122738"
    default_style = ""

    styles = {
        Text: "#fff",
        Whitespace: "",
        Error: "bg:#ff0000 #fff",
        Comment: "#0088ff italic",
        Comment.Hashbang: "#0088ff italic",
        Comment.Multiline: "#0088ff italic",
        Comment.Preproc: "#ff9d00",
        Comment.PreprocFile: "#3ad900",
        Comment.Single: "#0088ff italic",
        Comment.Special: "#0088ff italic bold",
        Keyword: "#ff9d00 bold",
        Keyword.Constant: "#ff628c",
        Keyword.Declaration: "#ff9d00 bold",
        Keyword.Namespace: "#ff9d00",
        Keyword.Pseudo: "#ff628c",
        Keyword.Reserved: "#ff9d00 bold",
        Keyword.Type: "#FF68B8",
        Operator: "#ff9d00",
        Operator.Word: "#ff9d00 bold",
        Literal: "#fff",
        Literal.Date: "#3ad900",
        Number: "#ff628c",
        Number.Bin: "#ff628c",
        Number.Float: "#ff628c",
        Number.Hex: "#ff628c",
        Number.Integer: "#ff628c",
        Number.Integer.Long: "#ff628c",
        Number.Oct: "#ff628c",
        String: "#3ad900",
        String.Affix: "#3ad900",
        String.Backtick: "#80fcff",
        String.Char: "#3ad900",
        String.Delimiter: "#3ad900",
        String.Doc: "#0088ff italic",
        String.Double: "#3ad900",
        String.Escape: "#80fcff",
        String.Heredoc: "#3ad900",
        String.Interpol: "#80fcff",
        String.Other: "#3ad900",
        String.Regex: "#fb94ff",
        String.Single: "#3ad900",
        String.Symbol: "#ff628c",
        Name: "#fff",
        Name.Attribute: "#ffc600",
        Name.Builtin: "#ffc600",
        Name.Builtin.Pseudo: "#ff628c",
        Name.Class: "#ffc600 bold",
        Name.Constant: "#ff628c",
        Name.Decorator: "#80fcff",
        Name.Entity: "#ffc600",
        Name.Exception: "#ff628c bold",
        Name.Function: "#ffc600",
        Name.Function.Magic: "#80fcff",
        Name.Label: "#ffc600",
        Name.Namespace: "#fff",
        Name.Other: "#fff",
        Name.Property: "#ffc600",
        Name.Tag: "#ff9d00",
        Name.Variable: "#fff",
        Name.Variable.Class: "#fff",
        Name.Variable.Global: "#fff",
        Name.Variable.Instance: "#fff",
        Name.Variable.Magic: "#80fcff",
        Generic: "#fff",
        Generic.Deleted: "#ff628c",
        Generic.Emph: "italic",
        Generic.Error: "#ff0000",
        Generic.Heading: "#ffc600 bold",
        Generic.Inserted: "#3ad900",
        Generic.Output: "#0088ff",
        Generic.Prompt: "#ff9d00 bold",
        Generic.Strong: "bold",
        Generic.Subheading: "#ffc600",
        Generic.Traceback: "#ff628c",
        Generic.Underline: "underline",
    }


STYLE_MAP["cobalt2"] = "pygments_cobalt2::Cobalt2Style"
