Upside Downside Unchanged Volume
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Nathan J. Hart (insideandup)
//
// Plot NYSE or NASDAQ Upside Volume, Downside Volume, or Unchanged Volume as a percent of Total Volume.
// Values are plotted 0 to 1 (where 1 = 100%), or 1% to 100%.
// Example of variables: USI:UPVOL.NY/DNVOL.NY/UNCHVOL.NY vs USI:TVOL.NY (Volume), USI:UVOL/DVOL/XVOL vs USI:TVOL (Volume), and USI:ADVN.NY/DECL.NY/UNCH.NY vs USI:ACTV.NY (Issues)
// Compare plotted data with published data here: https://www.wsj.com/market-data/stocks/marketsdiary
// Note: UVOL/DVOL option does not plot for DJIA and US stocks option. All other option combinations plot.
// Plot Day, Week, and Month volume and/or chart timeframe period volume.
// Plot volume as a histogram, line, or area.
// Plot various moving averages of volume points.
// Horizontal lines at 0, .10, .30, .50, .70, .90, and 1.00 levels.
// Inspired by Paul Desmond of Lowry’s Reports: https://docs.cmtassociation.org/docs/2002DowAwardb.pdf
//
// Created: July 26, 2023
// Last edited: August 17, 2023
//
// @version=5

indicator("Percent Upside Volume by 3iau", shorttitle="% Upside Vol", precision=2)

// Tillson's Moving Average

a = 0.618033989 // Tillson applied a = 0.7, here applying the Golden ratio conjugate = |(1-√5)/2| = 0.618033989
a1 = -1*math.pow(a, 3)
a2 = 3*math.pow(a, 2) + 3*math.pow(a, 3)
a3 = -6*math.pow(a, 2) - 3*a - 3*math.pow(a, 3)
a4 = 1 + 3*a + math.pow(a, 3) + 3*math.pow(a, 2)

// moving average type selection

ma(source, length, type) =>
    type == "SMA" ? ta.sma(source, length) :
     type == "EMA" ? ta.ema(source, length) :
     type == "DEMA" ? 2 * ta.ema(source, length) - ta.ema(ta.ema(source, length), length) :
     type == "TEMA" ? 3 * ta.ema(source, length) - 3 * ta.ema(ta.ema(source, length), length) + ta.ema(ta.ema(ta.ema(source, length), length), length) :
     type == "QEMA" ? 5 * ta.ema(source, length) - 10 * ta.ema(ta.ema(source, length), length) + 10 * ta.ema(ta.ema(ta.ema(source, length), length), length) - 5 * ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length) + ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length) :
     type == "PEMA" ? 8 * ta.ema(source, length) - 28 * ta.ema(ta.ema(source, length), length) + 56 * ta.ema(ta.ema(ta.ema(source, length), length), length) - 70 * ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length) + 56 * ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length) - 28 * ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length), length) + 8 * ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length), length), length) - ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length), length), length), length) :
     type == "ZLEMA" ? ta.ema(source + (source - source[math.round((length - 1) / 2)]), length) :
     type == "T3" ? a1 * ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length), length) + a2 * ta.ema(ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length), length) + a3 * ta.ema(ta.ema(ta.ema(ta.ema(source, length), length), length), length) + a4 * ta.ema(ta.ema(ta.ema(source, length), length), length) :
     type == "HMA" ? ta.hma(source, length) :
     type == "SMMA" ? ta.rma(source, length) :
     type == "WMA" ? ta.wma(source, length) :
     type == "VWMA" ? ta.vwma(source, length) :
     na


// VARIABLES
//
// ADVN/DECL NUMBER OF NAMES
//          ADVANCING       DECLINING       UNCHANGED       TRADING
// NYSE     USI:ADVN.NY     USI:DECL.NY     USI:UNCH.NY     USI:ACTV.NY
// NASDAQ   USI:ADVN.NQ     USI:DECL.NQ     USI:UNCH.NQ     USI:ACTV.NQ
// DJIA     USI:ADVN.DJ     USI:DECL.DJ     USI:UNCH.DJ     USI:ACTV.DJ
// US       USI:ADVN.US     USI:DECL.US     USI:UNCH.US     USI:ACTV.US
//
// UPVOL/DNVOL VOLUME OF SHARES IN THE GROUP "NUMBER OF NAMES"
//          ADVANCING       DECLINING       UNCHANGED       TRADING
// NYSE     USI:UPVOL.NY    USI:DNVOL.NY    USI:UNCHVOL.NY  USI:TVOL.NY
// NASDAQ   USI:UPVOL.NQ    USI:DNVOL.NQ    USI:UNCHVOL.NQ  USI:TVOL.NQ
// DJIA     USI:UPVOL.DJ    USI:DNVOL.DJ    USI:UNCHVOL.DJ  USI:TVOL.DJ
// US       USI:UPVOL.US    USI:DNVOL.US    USI:UNCHVOL.US  USI:TVOL.US
//
// ADV/DECL NUMBER OF NAMES
//          ADVANCING       DECLINING       UNCHANGED       TRADING
// NYSE     USI:ADV         USI:DECL        USI:UCHG        USI:ADV+USI:DECL+USI:UCHG
// NASDAQ   USI:ADVQ        USI:DECLQ       USI:UCHGQ       USI:ADVQ+USI:DECLQ+USI:UCHGQ
// DJIA     n.a.
// US       n.a.
//
// UVOL/DVOL VOLUME OF SHARES IN THE GROUP "NUMBER OF NAMES"
//          ADVANCING       DECLINING       UNCHANGED       TRADING
// NYSE     USI:UVOL        USI:DVOL        USI:XVOL        USI:TVOL
// NASDAQ   USI:UVOLQ       USI:DVOLQ       USI:XVOLQ       USI:TVOLQ
// DJIA     n.a.
// US       n.a.
//
// Compare data https://www.wsj.com/market-data/stocks/marketsdiary

volume_source = input.string(defval = "NYSE", title = "Exchange", options = ["NYSE", "NASDAQ", "DJIA", "US"], inline = "Source", group = "Volume Source, Type, and Direction")
volume_type = input.string(defval = "ADVN/DECL", title = "Variables", options = ["ADVN/DECL", "UPVOL/DNVOL", "ADV/DECL", "UVOL/DVOL"], inline = "Type", group = "Volume Source, Type, and Direction")
volume_direction = input.string(defval = "Upside", title = "Direction", options = ["Upside", "Downside", "Unchanged"], inline = "Direction", group = "Volume Source, Type, and Direction")

up = "USI:ADVN.NY"
down = "USI:DECL.NY"
unchanged = "USI:UNCH.NY"
total = "USI:ACTV.NY"

if (volume_source == "NYSE") 
    up := volume_type == "ADVN/DECL" ? "USI:ADVN.NY" : volume_type == "UPVOL/DNVOL" ? "USI:UPVOL.NY" : volume_type == "ADV/DECL" ? "USI:ADV" : volume_type == "UVOL/DVOL" ? "USI:UVOL" : "USI:ADVN.NY"
    down := volume_type == "ADVN/DECL" ? "USI:DECL.NY" : volume_type == "UPVOL/DNVOL" ? "USI:UPVOL.NY" : volume_type == "ADV/DECL" ? "USI:DECL" : volume_type == "UVOL/DVOL" ? "USI:DVOL" : "USI:DECL.NY"
    unchanged := volume_type == "ADVN/DECL" ? "USI:UNCH.NY" : volume_type == "UPVOL/DNVOL" ? "USI:UNCHVOL.NY" : volume_type == "ADV/DECL" ? "USI:UCHG" : volume_type == "UVOL/DVOL" ? "USI:XVOL" : "USI:UNCH.NY"
    total := volume_type == "ADVN/DECL" ? "USI:ACTV.NY" : volume_type == "UPVOL/DNVOL" ? "USI:TVOL.NY" : volume_type == "ADV/DECL" ? "USI:ADV + USI:DECL + USI:UCHG" : volume_type == "UVOL/DVOL" ? "USI:TVOL" : "USI:TVOL.NY"
else
    if (volume_source == "NASDAQ")
        up := volume_type == "UPVOL/DNVOL" ? "USI:UPVOL.NQ" : volume_type == "UVOL/DVOL" ? "USI:UVOLQ" : "USI:ADVN.NQ"
        down := volume_type == "UPVOL/DNVOL" ? "USI:DNVOL.NQ" : volume_type == "UVOL/DVOL" ? "USI:DVOLQ" : "USI:DECL.NQ"
        unchanged := volume_type == "UPVOL/DNVOL" ? "USI:UNCHVOL.NQ" : volume_type == "UVOL/DVOL" ? "USI:XVOLQ" : "USI:UNCH.NQ"
        total := volume_type == "UPVOL/DNVOL" ? "USI:TVOL.NQ" : volume_type == "UVOL/DVOL" ? "USI:TVOLQ" : "USI:ACTV.NQ"
    else
        if (volume_source == "DJIA")
            up := volume_type == "UPVOL/DNVOL" ? "USI:UPVOL.DJ" : volume_type == "UVOL/DVOL" ? na : "USI:ADVN.DJ"
            down := volume_type == "UPVOL/DNVOL" ? "USI:DNVOL.DJ" : volume_type == "UVOL/DVOL" ? na : "USI:DECL.DJ"
            unchanged := volume_type == "UPVOL/DNVOL" ? "USI:UNCHVOL.DJ" : volume_type == "UVOL/DVOL" ? na : "USI:UNCH.DJ"
            total := volume_type == "UPVOL/DNVOL" ? "USI:TVOL.DJ" : volume_type == "UVOL/DVOL" ? na : "USI:ACTV.DJ"
        else
            if (volume_source == "US")
                up := volume_type == "UPVOL/DNVOL" ? "USI:UPVOL.US" : volume_type == "UVOL/DVOL" ? na : "USI:ADVN.US"
                down := volume_type == "UPVOL/DNVOL" ? "USI:DNVOL.US" : volume_type == "UVOL/DVOL" ? na : "USI:DECL.US"
                unchanged := volume_type == "UPVOL/DNVOL" ? "USI:UNCHVOL.US" : volume_type == "UVOL/DVOL" ? na : "USI:UNCH.US"
                total := volume_type == "UPVOL/DNVOL" ? "USI:TVOL.US" : volume_type == "UVOL/DVOL" ? na : "USI:ACTV.US"

// Calculations
// request.security(symbol, timeframe, expression, gaps, lookahead, ignore_invalid_symbol, currency)
// volume(up) / volume(total) returns a value is 0 to 1, 100 * volume(up) / volume(total) returns a percent 0 to 100%

// Previous Day Close Percent Up-volume Calculations

timeframe = input.string(defval = "Chart", title = "Timeframe", options = ["Chart", "Day", "Week", "Month"], inline = "Timeframe", group = "Plot Previous Day/Week/Month Volume")

volumedayclose(x) => request.security(x, timeframe == "Day" ? "D" : timeframe == "Week" ? "W" : timeframe == "Month" ? "M" : timeframe.period, close) 
daypercentup = 100 * volumedayclose(up) / volumedayclose(total)
daypercentdown = 100 * volumedayclose(down) / volumedayclose(total)
daypercentunchanged = 100 * volumedayclose(unchanged) / volumedayclose(total)

// Chart Time-Period Previous Period Close Up-volume Calculations

volumeperiodclose(y) => request.security(y, timeframe.period, close)
periodpercentup = 100 * volumeperiodclose(up) / volumeperiodclose(total)
periodpercentdown = 100 * volumeperiodclose(down) / volumeperiodclose(total)
periodpercentunchanged = 100 * volumeperiodclose(unchanged) / volumeperiodclose(total)

// Plot Up, Down, or Unchanged

daypercent = daypercentup

if (volume_direction == "Upside") 
    daypercent := daypercentup
else
    if (volume_direction == "Downside")
        daypercent := daypercentdown 
    else
        if (volume_direction == "Unchanged") 
            daypercent := daypercentunchanged

periodpercent = periodpercentup

if (volume_direction == "Upside") 
    periodpercent := periodpercentup
else
    if (volume_direction == "Downside")
        periodpercent := periodpercentdown 
    else
        if (volume_direction == "Unchanged") 
            periodpercent := periodpercentunchanged

// TABLE

var table table_value = table.new(position.top_right, columns = 1, rows = 3)
display_value_upside = periodpercentup
display_value_downside = periodpercentdown
if barstate.islast
    table.cell(table_value, column = 0, row = 0, text = volume_source, text_color = color.rgb(220, 223, 228, 0), text_halign = text.align_right, text_valign = text.align_center, text_size = size.small)
    table.cell(table_value, column = 0, row = 1, text = str.tostring(math.round(display_value_upside, 2)) + " % up", text_color = color.rgb(220, 223, 228, 0), text_halign = text.align_right, text_valign = text.align_center, text_size = size.small)
    table.cell(table_value, column = 0, row = 2, text = str.tostring(math.round(display_value_downside, 2)) + " % dn", text_color = color.rgb(220, 223, 228, 0), text_halign = text.align_right, text_valign = text.align_center, text_size = size.small)

// Plot Previous Day Percent Up/Down/Unchanged Volume

show_columns_daypercent = input(defval = false, title = "Columns", inline = "Day Columns", group = "Plot Previous Day/Week/Month Volume")
show_line_daypercent = input(defval = false, title = "Line", inline = "Day Line", group = "Plot Previous Day/Week/Month Volume")
show_area_daypercent = input(defval = false, title = "Area", inline = "Day Area", group = "Plot Previous Day/Week/Month Volume")

plotcolor_daypercent_columns = daypercent >= 90 ? color.rgb(97, 175, 239, 10) : daypercent >= 80 and daypercent < 90 ? color.rgb(97, 175, 239, 30) : daypercent >= 70 and daypercent < 80 ? color.rgb(97, 175, 239, 50) : daypercent <= 30 and daypercent > 20 ? color.rgb(97, 175, 239, 50) : daypercent <= 20 and daypercent > 10 ? color.rgb(97, 175, 239, 30) : daypercent <= 10 ? color.rgb(97, 175, 239, 10) : color.rgb(97, 175, 239, 80)
plotcolor_line_daypercent = color.rgb(97, 175, 239, 10)
plotcolor_area_daypercent = color.rgb(97, 175, 239, 70)
plot_columns_daypercent = plot(show_columns_daypercent ? daypercent : na, "Day Columns", plotcolor_daypercent_columns, style=plot.style_columns)
plot_line_daypercent = plot(show_line_daypercent ? daypercent : na, "Day Line", plotcolor_line_daypercent, style=plot.style_line)
plot_area_daypercent = plot(show_area_daypercent ? daypercent : na, "Day Area", plotcolor_area_daypercent, style=plot.style_area)

// All Values Moving Average

show_smoothed_daypercent = input(defval = false, title = "", inline = "Smoothing", group = "Plot Day/Week/Month Volume Moving Average")
smoothed_daypercent_type = input.string(defval = "EMA", title = "", options = ["SMA", "EMA", "DEMA", "TEMA", "QEMA", "PEMA", "ZLEMA", "T3", "HMA", "SMMA", "WMA", "VWMA"], inline = "Smoothing", group = "Plot Day/Week/Month Volume Moving Average")
smoothed_daypercent_length = input.int(defval = 10, title = "", minval = 2, maxval = 2000, inline = "Smoothing", group = "Plot Day/Week/Month Volume Moving Average")
smoothed_daypercent = ma(daypercent, smoothed_daypercent_length, smoothed_daypercent_type)
plotcolor_smoothed_daypercent = color.rgb(229, 192, 123, 0)
plot_smoothed_daypercent = plot(show_smoothed_daypercent ? smoothed_daypercent : na, "Moving Average", plotcolor_smoothed_daypercent, style=plot.style_line)

// High/Low Values Moving Averages

daypercent_high = 0.00
daypercent_low = 0.00

if (volume_direction == "Upside") 
    daypercent_high := daypercent >= smoothed_daypercent ? daypercentup : na
    daypercent_low := daypercent <= smoothed_daypercent ? daypercentup : na
else
    if (volume_direction == "Downside")
        daypercent_high := daypercent >= smoothed_daypercent ? daypercentdown : na
        daypercent_low := daypercent <= smoothed_daypercent ? daypercentdown : na
    else
        if (volume_direction == "Unchanged") 
            daypercent_high := daypercent >= smoothed_daypercent ? daypercentunchanged : na
            daypercent_low := daypercent <= smoothed_daypercent ? daypercentunchanged : na

show_daypercent_high_ma = input(defval = true, title = "", inline = "High MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")
daypercent_high_ma_type = input.string(defval = "EMA", title = "", options = ["SMA", "EMA", "DEMA", "TEMA", "QEMA", "PEMA", "ZLEMA", "T3", "HMA", "SMMA", "WMA", "VWMA"], inline = "High MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")
daypercent_high_ma_length = input.int(defval = 10, title = "", minval = 2, maxval = 2000, inline = "High MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")

show_daypercent_low_ma = input(defval = true, title = "", inline = "Low MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")
daypercent_low_ma_type = input.string(defval = "EMA", title = "", options = ["SMA", "EMA", "DEMA", "TEMA", "QEMA", "PEMA", "ZLEMA", "T3", "HMA", "SMMA", "WMA", "VWMA"], inline = "Low MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")
daypercent_low_ma_length = input.int(defval = 10, title = "", minval = 2, maxval = 2000, inline = "Low MA", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")

daypercent_high_ma = ma(daypercent_high, daypercent_high_ma_length, daypercent_high_ma_type)
daypercent_low_ma = ma(daypercent_low, daypercent_low_ma_length, daypercent_low_ma_type)

plot_daypercent_high_ma = plot(show_daypercent_high_ma ? daypercent_high_ma : na, "Moving Average", color.rgb(97, 175, 239, 80), style=plot.style_line)
plot_daypercent_low_ma = plot(show_daypercent_low_ma ? daypercent_low_ma : na, "Moving Average", color.rgb(97, 175, 239, 80), style=plot.style_line)

show_daypercent_ma_fill = input(defval = true, title = "High/Low MA Fill", inline = "", group = "Plot Moving Averages of the High/Low Values--those values Above/Below the Moving Average of the values plotted")
plot_daypercent_high_ma_fill = plot(show_daypercent_ma_fill ? daypercent_high_ma : na, "Moving Average", color.rgb(97, 175, 239, 90), style=plot.style_line)
plot_daypercent_low_ma_fill = plot(show_daypercent_ma_fill ? daypercent_low_ma : na, "Moving Average", color.rgb(97, 175, 239, 90), style=plot.style_line)
fill(plot1 = plot_daypercent_low_ma_fill, plot2 = plot_daypercent_high_ma_fill, title = "fill", editable = true, fillgaps = true, color = color.rgb(97, 175, 239, 90))

// Plot Chart Time-Period Previous Period Percent Up/Down/Unchanged Volume

show_columns_periodpercent = input(defval = false, title = "Columns", inline = "Period Columns", group = "Plot Chart Timeframe Previous Period's Volume")
show_line_periodpercent = input(defval = true, title = "Line", inline = "Period Line", group = "Plot Chart Timeframe Previous Period's Volume")
show_area_periodpercent = input(defval = false, title = "Area", inline = "Period Area", group = "Plot Chart Timeframe Previous Period's Volume")

plotcolor_periodpercent_columns = periodpercent >= 90 ? color.rgb(97, 175, 239, 10) : periodpercent >= 80 and periodpercent < 90 ? color.rgb(97, 175, 239, 30) : periodpercent >= 70 and periodpercent < 80 ? color.rgb(97, 175, 239, 50) : periodpercent <= 30 and periodpercent > 20 ? color.rgb(97, 175, 239, 50) : periodpercent <= 20 and periodpercent > 10 ? color.rgb(97, 175, 239, 30) : periodpercent <= 10 ? color.rgb(97, 175, 239, 10) : color.rgb(97, 175, 239, 80)
plotcolor_line_periodpercent = color.rgb(97, 175, 239, 10)
plotcolor_area_periodpercent = color.rgb(97, 175, 239, 70)
plot_columns_periodpercent = plot(show_columns_periodpercent ? periodpercent : na, "Period Columns", plotcolor_periodpercent_columns, style=plot.style_columns)
plot_line_periodpercent = plot(show_line_periodpercent ? periodpercent : na, "Period Line", plotcolor_line_periodpercent, style=plot.style_line)
plot_area_periodpercent = plot(show_area_periodpercent ? periodpercent : na, "Period Area", plotcolor_area_periodpercent, style=plot.style_area)

show_smoothed_periodpercent = input(defval = true, title = "", inline = "Period Smoothing", group = "Plot Period Volume Moving Average")
smoothed_periodpercent_type = input.string(defval = "EMA", title = "", options = ["SMA", "EMA", "DEMA", "TEMA", "QEMA", "PEMA", "ZLEMA", "T3", "HMA", "SMMA", "WMA", "VWMA"], inline = "Period Smoothing", group = "Plot Period Volume Moving Average")
smoothed_periodpercent_length = input.int(defval = 10, title = "", minval = 2, maxval = 2000, inline = "Period Smoothing", group = "Plot Period Volume Moving Average")
smoothed_periodpercent = ma(periodpercent, smoothed_periodpercent_length, smoothed_periodpercent_type)
plotcolor_smoothed_periodpercent = color.rgb(229, 192, 123, 0)
plot_smoothed_periodpercent = plot(show_smoothed_periodpercent ? smoothed_periodpercent : na, "Period Moving Average", plotcolor_smoothed_periodpercent, style=plot.style_line)

// Display Horizontal Lines 

obPlot = hline(103, title="Upper Band", linestyle=hline.style_solid, color=color.rgb(220, 223, 228, 95), linewidth=1) // white 220, 223, 228
hline(100, title="100% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 40), linewidth=1) // white 220, 223, 228
hline(90, title="90% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 50), linewidth=1) // white 220, 223, 228
hline(70, title="70% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 40), linewidth=1) // white 220, 223, 228
//hline(55, title="55% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 20), linewidth=1) // white 220, 223, 228
hline(50, title="50% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 20), linewidth=1) // white 220, 223, 228
//hline(45, title="45% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 20), linewidth=1) // white 220, 223, 228
hline(30, title="30% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 40), linewidth=1) // white 220, 223, 228
hline(10, title="10% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 50), linewidth=1) // white 220, 223, 228
hline(0, title="0% Level", linestyle=hline.style_dotted, color=color.rgb(220, 223, 228, 40), linewidth=1) // white 220, 223, 228
osPlot = hline(-3, title="Lower Band", linestyle=hline.style_solid, color=color.rgb(220, 223, 228, 95), linewidth=1) // white 220, 223, 228
fill(obPlot, osPlot, title="Background", color=color.rgb(220, 223, 228, 99)) // white 220, 223, 228

// NOTES
//
// COLOR SCHEMES
//
// ONE HALF DARK by Son A. Pham at github.com/sonph/onehalf
//            HEX      RGB
// black      #282c34  40, 44, 52
// red        #e06c75  224, 108, 117
// green      #98c379  152, 195, 121
// yellow     #e5c07b  229, 192, 123
// blue       #61afef  97, 175, 239
// magenta    #c678dd  198, 120, 221
// cyan       #56b6c2  86, 182, 194
// white      #dcdfe4  220, 223, 228
// foreground #dcdfe4  220, 223, 228
// background #282c34  40, 44, 52
//
//
// END