Generating GUISkin by code?

Hi
I am trying to make my code into a dll, I managed to patch the png images into the solution, but as much as i understand, now i need to generate all the custom styles and the gui skin by the code myself, this is what i have :

public static GUISkin DarkSkin;
        public static GUISkin LightSkin;

        static GuiStyleUtility()
        {
            DarkSkin = GetDarkSkin();
            LightSkin = GetLightSkin();
        }

        private static GUISkin GetDarkSkin()
        {
            GUISkin skin = ScriptableObject.CreateInstance<GUISkin>();
            List<GUIStyle> styles = new List<GUIStyle>();
GUIStyle style = new GUIStyle
            {
                name = "ToolsViewBackground",
                normal =
                {
                    background = Resource.ViewBackNormalDark,
                    textColor = GraphicUtility.ColorFrom256(193, 193, 193, 75)
                },
                border = new RectOffset(2, 2, 2, 2),
                fontSize = 18,
                alignment = TextAnchor.MiddleCenter,
                stretchWidth = true
            };
            styles.Add(style);

            skin.customStyles = styles.ToArray();
            skin.hideFlags = HideFlags.HideAndDontSave;
            return skin;
        }
    }

As much as I understand, this should generate the Gui skin and assign it to the public constant DarkSKin and i should be able to access it outside of the static class, but, when i generate the custom editor window that is using this skin it yells that the custom style is not found, of course i triple checked the typing and there is no error there.
so how can i make this work? or how can I make a gui skin totally by code myself?

ProjectWindowUtil.CreateNewGUISkin();

someone exposed the code here

or you can do this. which give you more control over creation. best method

            GUISkin myGUISkin = new GUISkin();

            myGUISkin.name = "MyGUISkin";

           // set you box, button, slider ... values 
          // myGUISkin.box.hover.background  = SOME TEXTURE

           GUISkin gs = ScriptableObject.CreateInstance<GUISkin>();
           gs = myGUISkin;
           // create the new skin in the Assets folder
           AssetDatabase.CreateAsset(gs, "Assets");

now , I must say … our projects look eerily similar . I am working with light and dark skins for my project too.I found a great way to work with images in the dll. you want to get you want to read the font files from your dll next right ?

@DMDev I figured out the problem with my code, can’t believe a single typo passed me after 4 times of code check. and yes I tried to use fonts as resources in my project but I couldn’t figure out a way that would accept the font as byte and produce the font within the code, you know something that may work? right now, I can only think about some static script that uses InitializeOnLoad to copy the font from resources and put it into a resources folder by using system.io not unity itself and i don’t like that solution :confused: