goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.92k stars 113 forks source link

Struggling to highlight characters using header.opts.hl #263

Open okkdev opened 9 months ago

okkdev commented 9 months ago

Hi, I'm generating pokemon sprites with highlight groups, but the highlighting isn't behaving how I'm expecting and I can't figure out how to apply it correctly.

I'm trying to set the color of each individual pixel that has a color by generating the highlight group named PokePixel_ROW_COLUMN and then adding them to the opts.hl two dimensional table as {"PokePixel_ROW_COLUMN", COLUMN, COLUMN+1}

This is how it should look:

image

This is how it's currently looking in alpha nvim:

image

This is the code:

local sprite = {
  [[       ▄▀▀▄▄▄          ]],
  [[       ▀▀▀▀▀▀▀▀▀▀▀     ]],
  [[      ▄▀▀▀▀▀▀▀▀▀▀▀  ▄▀▄]],
  [[      ▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀]],
  [[     ▀▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀]],
  [[ ▄▄▄▄▀▀▀▀▀▀▀▀▀▀▀▀▄▀▀▀▀ ]],
  [[▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ]],
  [[ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ]],
  [[    ▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀   ]],
  [[            ▀▀▀        ]],
  [[             ▀         ]],
}

local function set_colors()
  vim.api.nvim_set_hl(0, "PokePixel_0_7", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_0_8", { fg = "#000000", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_0_9", { fg = "#000000", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_0_10", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_0_11", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_0_12", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_2_7", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_2_8", { fg = "#c5ad31", bg = "#9c843a" })
  vim.api.nvim_set_hl(0, "PokePixel_2_9", { fg = "#9c843a", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_10", { fg = "#9c843a", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_11", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_12", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_13", { fg = "#000000", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_14", { fg = "#000000", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_2_15", { fg = "#000000", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_2_16", { fg = "#000000", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_2_17", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_4_6", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_4_7", { fg = "#000000", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_8", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_9", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_10", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_11", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_12", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_13", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_14", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_15", { fg = "#f7de42", bg = "#c5a573" })
  vim.api.nvim_set_hl(0, "PokePixel_4_16", { fg = "#c5a573", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_4_17", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_4_20", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_4_21", { fg = "#000000", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_4_22", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_6", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_7", { fg = "#000000", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_6_8", { fg = "#f7de42", bg = "#9c843a" })
  vim.api.nvim_set_hl(0, "PokePixel_6_9", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_6_10", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_6_11", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_6_12", { fg = "#f7de42", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_13", { fg = "#f7de42", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_14", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_6_15", { fg = "#c5ad31", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_6_16", { fg = "#c5ad31", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_6_17", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_20", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_6_21", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_6_22", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_5", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_6", { fg = "#7b523a", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_7", { fg = "#414141", bg = "#7b523a" })
  vim.api.nvim_set_hl(0, "PokePixel_8_8", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_8_9", { fg = "#f7de42", bg = "#ffffff" })
  vim.api.nvim_set_hl(0, "PokePixel_8_10", { fg = "#f7de42", bg = "#ffffff" })
  vim.api.nvim_set_hl(0, "PokePixel_8_11", { fg = "#9c843a", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_8_12", { fg = "#c5ad31", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_8_13", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_8_14", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_8_15", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_16", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_19", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_8_20", { fg = "#9c733a", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_8_21", { fg = "#9c733a", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_8_22", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_1", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_2", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_3", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_4", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_5", { fg = "#000000", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_10_6", { fg = "#9c843a", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_10_7", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_10_8", { fg = "#414141", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_10_9", { fg = "#414141", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_10", { fg = "#414141", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_11", { fg = "#414141", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_10_12", { fg = "#414141", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_10_13", { fg = "#414141", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_14", { fg = "#9c733a", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_15", { fg = "#9c733a", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_16", { fg = "#000000", bg = "#9c733a" })
  vim.api.nvim_set_hl(0, "PokePixel_10_17", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_10_18", { fg = "#000000", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_10_19", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_10_20", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_10_21", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_12_0", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_12_1", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_2", { fg = "#c5ad31", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_3", { fg = "#414141", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_4", { fg = "#f7de42", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_5", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_12_6", { fg = "#414141", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_7", { fg = "#414141", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_12_8", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_9", { fg = "#c5ad31", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_12_10", { fg = "#9c733a", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_11", { fg = "#9c733a", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_12", { fg = "#414141", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_13", { fg = "#414141", bg = "#9c843a" })
  vim.api.nvim_set_hl(0, "PokePixel_12_14", { fg = "#9c733a", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_15", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_16", { fg = "#414141", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_12_17", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_18", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_12_19", { fg = "#c5ad31", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_12_20", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_1", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_2", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_3", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_4", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_5", { fg = "#f7de42", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_6", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_7", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_8", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_14_9", { fg = "#414141", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_10", { fg = "#c5ad31", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_14_11", { fg = "#414141", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_14_12", { fg = "#414141", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_13", { fg = "#c5ad31", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_14_14", { fg = "#414141", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_15", { fg = "#414141", bg = "#414141" })
  vim.api.nvim_set_hl(0, "PokePixel_14_16", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_14_17", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_18", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_14_19", { fg = "#414141", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_14_20", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_4", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_5", { fg = "#f7de42", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_6", { fg = "#f7de42", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_7", { fg = "#414141", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_8", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_11", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_12", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_16_13", { fg = "#f7de42", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_16_14", { fg = "#f7de42", bg = "#c5ad31" })
  vim.api.nvim_set_hl(0, "PokePixel_16_15", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_16", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_17", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_18", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_16_19", { fg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_18_12", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_18_13", { fg = "#c5ad31", bg = "#f7de42" })
  vim.api.nvim_set_hl(0, "PokePixel_18_14", { fg = "#000000", bg = "#000000" })
  vim.api.nvim_set_hl(0, "PokePixel_20_13", { fg = "#000000" })
end

local hl = {
  {{ "PokePixel_0_7", 7, 8 }, { "PokePixel_0_8", 8, 9 }, { "PokePixel_0_9", 9, 10 }, { "PokePixel_0_10", 10, 11 }, { "PokePixel_0_11", 11, 12 }, { "PokePixel_0_12", 12, 13 }, },
  {{ "PokePixel_2_7", 7, 8 }, { "PokePixel_2_8", 8, 9 }, { "PokePixel_2_9", 9, 10 }, { "PokePixel_2_10", 10, 11 }, { "PokePixel_2_11", 11, 12 }, { "PokePixel_2_12", 12, 13 }, { "PokePixel_2_13", 13, 14 }, { "PokePixel_2_14", 14, 15 }, { "PokePixel_2_15", 15, 16 }, { "PokePixel_2_16", 16, 17 }, { "PokePixel_2_17", 17, 18 }, },
  {{ "PokePixel_4_6", 6, 7 }, { "PokePixel_4_7", 7, 8 }, { "PokePixel_4_8", 8, 9 }, { "PokePixel_4_9", 9, 10 }, { "PokePixel_4_10", 10, 11 }, { "PokePixel_4_11", 11, 12 }, { "PokePixel_4_12", 12, 13 }, { "PokePixel_4_13", 13, 14 }, { "PokePixel_4_14", 14, 15 }, { "PokePixel_4_15", 15, 16 }, { "PokePixel_4_16", 16, 17 }, { "PokePixel_4_17", 17, 18 }, { "PokePixel_4_20", 20, 21 }, { "PokePixel_4_21", 21, 22 }, { "PokePixel_4_22", 22, 23 }, },
  {{ "PokePixel_6_6", 6, 7 }, { "PokePixel_6_7", 7, 8 }, { "PokePixel_6_8", 8, 9 }, { "PokePixel_6_9", 9, 10 }, { "PokePixel_6_10", 10, 11 }, { "PokePixel_6_11", 11, 12 }, { "PokePixel_6_12", 12, 13 }, { "PokePixel_6_13", 13, 14 }, { "PokePixel_6_14", 14, 15 }, { "PokePixel_6_15", 15, 16 }, { "PokePixel_6_16", 16, 17 }, { "PokePixel_6_17", 17, 18 }, { "PokePixel_6_20", 20, 21 }, { "PokePixel_6_21", 21, 22 }, { "PokePixel_6_22", 22, 23 }, },
  {{ "PokePixel_8_5", 5, 6 }, { "PokePixel_8_6", 6, 7 }, { "PokePixel_8_7", 7, 8 }, { "PokePixel_8_8", 8, 9 }, { "PokePixel_8_9", 9, 10 }, { "PokePixel_8_10", 10, 11 }, { "PokePixel_8_11", 11, 12 }, { "PokePixel_8_12", 12, 13 }, { "PokePixel_8_13", 13, 14 }, { "PokePixel_8_14", 14, 15 }, { "PokePixel_8_15", 15, 16 }, { "PokePixel_8_16", 16, 17 }, { "PokePixel_8_19", 19, 20 }, { "PokePixel_8_20", 20, 21 }, { "PokePixel_8_21", 21, 22 }, { "PokePixel_8_22", 22, 23 }, },
  {{ "PokePixel_10_1", 1, 2 }, { "PokePixel_10_2", 2, 3 }, { "PokePixel_10_3", 3, 4 }, { "PokePixel_10_4", 4, 5 }, { "PokePixel_10_5", 5, 6 }, { "PokePixel_10_6", 6, 7 }, { "PokePixel_10_7", 7, 8 }, { "PokePixel_10_8", 8, 9 }, { "PokePixel_10_9", 9, 10 }, { "PokePixel_10_10", 10, 11 }, { "PokePixel_10_11", 11, 12 }, { "PokePixel_10_12", 12, 13 }, { "PokePixel_10_13", 13, 14 }, { "PokePixel_10_14", 14, 15 }, { "PokePixel_10_15", 15, 16 }, { "PokePixel_10_16", 16, 17 }, { "PokePixel_10_17", 17, 18 }, { "PokePixel_10_18", 18, 19 }, { "PokePixel_10_19", 19, 20 }, { "PokePixel_10_20", 20, 21 }, { "PokePixel_10_21", 21, 22 }, },
  {{ "PokePixel_12_0", 0, 1 }, { "PokePixel_12_1", 1, 2 }, { "PokePixel_12_2", 2, 3 }, { "PokePixel_12_3", 3, 4 }, { "PokePixel_12_4", 4, 5 }, { "PokePixel_12_5", 5, 6 }, { "PokePixel_12_6", 6, 7 }, { "PokePixel_12_7", 7, 8 }, { "PokePixel_12_8", 8, 9 }, { "PokePixel_12_9", 9, 10 }, { "PokePixel_12_10", 10, 11 }, { "PokePixel_12_11", 11, 12 }, { "PokePixel_12_12", 12, 13 }, { "PokePixel_12_13", 13, 14 }, { "PokePixel_12_14", 14, 15 }, { "PokePixel_12_15", 15, 16 }, { "PokePixel_12_16", 16, 17 }, { "PokePixel_12_17", 17, 18 }, { "PokePixel_12_18", 18, 19 }, { "PokePixel_12_19", 19, 20 }, { "PokePixel_12_20", 20, 21 }, },
  {{ "PokePixel_14_1", 1, 2 }, { "PokePixel_14_2", 2, 3 }, { "PokePixel_14_3", 3, 4 }, { "PokePixel_14_4", 4, 5 }, { "PokePixel_14_5", 5, 6 }, { "PokePixel_14_6", 6, 7 }, { "PokePixel_14_7", 7, 8 }, { "PokePixel_14_8", 8, 9 }, { "PokePixel_14_9", 9, 10 }, { "PokePixel_14_10", 10, 11 }, { "PokePixel_14_11", 11, 12 }, { "PokePixel_14_12", 12, 13 }, { "PokePixel_14_13", 13, 14 }, { "PokePixel_14_14", 14, 15 }, { "PokePixel_14_15", 15, 16 }, { "PokePixel_14_16", 16, 17 }, { "PokePixel_14_17", 17, 18 }, { "PokePixel_14_18", 18, 19 }, { "PokePixel_14_19", 19, 20 }, { "PokePixel_14_20", 20, 21 }, },
  {{ "PokePixel_16_4", 4, 5 }, { "PokePixel_16_5", 5, 6 }, { "PokePixel_16_6", 6, 7 }, { "PokePixel_16_7", 7, 8 }, { "PokePixel_16_8", 8, 9 }, { "PokePixel_16_11", 11, 12 }, { "PokePixel_16_12", 12, 13 }, { "PokePixel_16_13", 13, 14 }, { "PokePixel_16_14", 14, 15 }, { "PokePixel_16_15", 15, 16 }, { "PokePixel_16_16", 16, 17 }, { "PokePixel_16_17", 17, 18 }, { "PokePixel_16_18", 18, 19 }, { "PokePixel_16_19", 19, 20 }, },
  {{ "PokePixel_18_12", 12, 13 }, { "PokePixel_18_13", 13, 14 }, { "PokePixel_18_14", 14, 15 }, },
  {{ "PokePixel_20_13", 13, 14 }, },
}

local alpha = require("alpha")
local theta = require("alpha.themes.theta")

set_colors()
theta.header.val = sprite
theta.header.opts.hl = hl

alpha.setup(theta.config)
goolord commented 9 months ago

this is a cool idea and basically exactly what I envisioned when i made that feature, so I'll try to figure this out soon

goolord commented 8 months ago
:print(vim.strdisplaywidth('▄▀'))
>> 2

ah, this might be the problem. even though it's displayed in a single cell, ▄▀ takes up two columns, which is halving the resolution of the highlights compared to the pixels

goolord commented 8 months ago

so if you have some code that's generating local hl = { you should update it to calculate the highlight ranges using vim.strdisplaywidth instead of # or whatever @okkdev

okkdev commented 8 months ago

Hm, for me ▄▀ is not displayed in a single cell and it shouldn't. I set either or and if I need both I set the upper block and add a background color. 🤔

gaykitty commented 7 months ago

I'm trying to do the same same thing and getting the same problem. Any idea how to fix?

gaykitty commented 7 months ago

Okay so I got mine working. I had to count each or as having a width of 3, while other characters were still 1. I'm not sure how I was supposed to know this. Each of those characters renders as 1 cell wide for me and strdisplaywidth says they have a width of 1.