Exemplo n.º 1
0
        public ColorPalette(Bitmap palette)
        {
            /* PIXEL LOCATIONS  www.Paletton.com 400x75 PNG export palette

            Color               X   Y
            Primary.Primary     100 20
            Secondary.Primary   245 20
            Tertiary.Primary    350 20

            Primary.Light       30  60
            Primary.MTLight     75  60
            Primary.MTDark      125 60
            Primary.Dark        165 60

            Secondary.Light     210 60
            Secondary.MTLight   240 60
            Secondary.MTDark    265 60
            Secondary.Dark      285 60

            Tertiary.Light      310 60
            Tertiary.MTLight    340 60
            Tertiary.MTDark     360 60
            Tertiary.Dark       390 60

            */

            PrimarySet = new ColorSet()
            {
                Primary = new PaletteColor(palette.GetPixel(100, 20), "@primary.primary"),
                Light = new PaletteColor(palette.GetPixel(30, 60), "@primary.light"),
                MidToneLight = new PaletteColor(palette.GetPixel(75, 60), "@primary.mtlight"),
                MidToneDark = new PaletteColor(palette.GetPixel(125, 60), "@primary.mtdark"),
                Dark = new PaletteColor(palette.GetPixel(165, 60), "@primary.dark"),
            };
            SecondarySet = new ColorSet()
            {
                Primary = new PaletteColor(palette.GetPixel(245, 20), "@secondary.primary"),
                Light = new PaletteColor(palette.GetPixel(210, 60), "@secondary.light"),
                MidToneLight = new PaletteColor(palette.GetPixel(240, 60), "@secondary.mtlight"),
                MidToneDark = new PaletteColor(palette.GetPixel(265, 60), "@secondary.mtdark"),
                Dark = new PaletteColor(palette.GetPixel(285, 60), "@secondary.dark"),
            };
            TertiarySet = new ColorSet()
            {
                Primary = new PaletteColor(palette.GetPixel(350, 20), "@tertiary.primary"),
                Light = new PaletteColor(palette.GetPixel(310, 60), "@tertiary.light"),
                MidToneLight = new PaletteColor(palette.GetPixel(340, 60), "@tertiary.mtlight"),
                MidToneDark = new PaletteColor(palette.GetPixel(360, 60), "@tertiary.mtdark"),
                Dark = new PaletteColor(palette.GetPixel(390, 60), "@tertiary.dark"),
            };
        }
Exemplo n.º 2
0
 private void ApplyColorSet(ColorSet set, ref string css)
 {
     ApplyColorStyle(set.Primary, ref css);
     ApplyColorStyle(set.MidToneLight, ref css);
     ApplyColorStyle(set.MidToneDark, ref css);
     ApplyColorStyle(set.Light, ref css);
     ApplyColorStyle(set.Dark, ref css);
 }