zydezu / ModernX

My fork of modernX (a replacement for MPV that retains the functionality of the default OSC), adding additional features - see builds at: https://github.com/zydezu/mpvconfig
131 stars 5 forks source link

Allow hex color for seekbarfg_color with osc_color_convert() #50

Closed Samillion closed 2 days ago

Samillion commented 1 week ago

Function from mpv's osc.lua https://github.com/mpv-player/mpv/blob/master/player/lua/osc.lua#L104-L106

So that in modernx.conf it would allow hex:

seekbarfg_color="be4d25"

Usage in modernx.lua:

local function osc_color_convert(color)
    return color:sub(6,7) .. color:sub(4,5) ..  color:sub(2,3)
end

In local osc_styles = {, use the function:

SeekbarFg = "{\\blur1\\bord1\\1c&H" .. osc_color_convert(user_opts.seekbarfg_color) .. "&}",

The function should be used in all user_opts color options, then adjusting the default values to hex.

Side note: Excellent fork, thank you for all the work. Just discovered it yesterday and I'm enjoying it very much.

image