Example #1
0
        public void FillRectangle(double x, double y, double w, double h, ColorPreset FillColor, ColorPreset BorderColor)
        {
            // y2 = y2 -
            InitPageOffset(ref y);

            using (XGraphics gfx = XGraphics.FromPdfPage(currentPage))
            {
                XPen   pen   = new XPen(XColors.White);
                XBrush brush = XBrushes.White;
                gfx.DrawRectangle(pen, brush, x, y, w, h);
            }

            /*  Rectangle rect = new Rectangle();
             * rect.Width = x2 - x2;
             * rect.Height = y2 - y1;
             *
             #if !SILVERLIGHT
             * rect.Fill = Brushes.WhiteSmoke;
             #else
             * rect.Fill = WhiteBrush;
             #endif
             *
             * Canvas.SetTop(rect, y1);
             * Canvas.SetLeft(rect, x1);
             *
             * canvas.Children.Add(rect);
             */
        }
Example #2
0
        private SolidColorBrush GetPresetBrush(ColorPreset c)
        {
            switch (c)
            {
            case ColorPreset.Foreground:
                return(ForegroundBrush);

            case ColorPreset.ForegroundText:
                return(ForegroundText);

            case ColorPreset.MutedForeground:
                return(MutedForegroundBrush);

            case ColorPreset.Subtle:
                return(SubtleBrush);

            case ColorPreset.Accent:
                return(AccentBrush);

            case ColorPreset.Background:
                return(BackgroundBrush);

            default:
                return(ForegroundBrush);
            }
        }
Example #3
0
        private static void InitializeClasses()
        {
            colorPreset = ColorPreset.Patriotic;
            menuItems   = new List <IMenuItem>();

            var sumNumbers = new SumNumbers();

            menuItems.Add(sumNumbers);

            var averageTenScores = new AverageTenScores();

            menuItems.Add(averageTenScores);

            var averageSpecificScores = new AverageSpecificScores();

            menuItems.Add(averageSpecificScores);

            var averageUnspecifiedScores = new AverageUnspecifiedScores();

            menuItems.Add(averageUnspecifiedScores);

            var exit = new Exit();

            menuItems.Add(exit);

            mainMenu = new Menu(menuItems, "Calculating Averages", colorPreset);
        }
Example #4
0
        private void SetColorList()
        {
            if (isInitialized)
            {
                return;
            }

            isInitialized = true;
            colors2Display.Clear();
            foreach (ConfigNode colorNode in GameDatabase.Instance.GetConfigNodes("KK_ColorPreset"))
            {
                //if (!colorNode.HasValue("IsGrasColor") || bool.Parse(colorNode.GetValue("IsGrasColor")))
                //{
                //    continue;
                //}

                if (colorNode.HasValue("Name") && colorNode.HasValue("Color"))
                {
                    ColorPreset preset = new ColorPreset();
                    preset.name = colorNode.GetValue("Name");
                    Log.Normal("Adding Color to List" + preset.name);
                    preset.color = ConfigNode.ParseColor(colorNode.GetValue("Color"));
                    if (colorNode.HasValue("Texture"))
                    {
                        preset.texture = colorNode.GetValue("Texture");
                    }
                    colors2Display.Add(preset);
                }
            }
        }
Example #5
0
 public override void Close()
 {
     callBack       = delegate {
     };
     selectedPreset = null;
     base.Close();
 }
Example #6
0
    public static void CreateNew(string presetName, Color primary, Color secondary, Color leatherPrimary, Color metalPrimary, Color leatherSecondary, Color metalDark, Color metalSecondary, Color hair, Color skin, Color stubble, Color scar, Color bodyArt, Color eyes)
    {
        ColorPreset nColorPreset = CreateInstance <ColorPreset>();

        nColorPreset.primary          = primary;
        nColorPreset.secondary        = secondary;
        nColorPreset.leatherPrimary   = leatherPrimary;
        nColorPreset.metalPrimary     = metalPrimary;
        nColorPreset.leatherSecondary = leatherSecondary;
        nColorPreset.metalDark        = metalDark;
        nColorPreset.metalSecondary   = metalSecondary;
        nColorPreset.hair             = hair;
        nColorPreset.skin             = skin;
        nColorPreset.stubble          = stubble;
        nColorPreset.scar             = scar;
        nColorPreset.bodyArt          = bodyArt;
        nColorPreset.eyes             = eyes;

        if (string.IsNullOrEmpty(presetName))
        {
            presetName = $"Color preset {Instance.presets.Count}";
        }

        nColorPreset.name = presetName;
        AssetDatabase.AddObjectToAsset(nColorPreset, Instance);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
        Reload();
    }
Example #7
0
    public Color GetColorPreset(ColorPreset colorPreset)
    {
        switch (colorPreset)
        {
        case ColorPreset.Gray1:
            return(gray1);

        case ColorPreset.Gray2:
            return(gray2);

        case ColorPreset.Gray3:
            return(gray3);

        case ColorPreset.Gray4:
            return(gray4);

        case ColorPreset.Gray5:
            return(gray5);

        case ColorPreset.Black:
            return(black);

        case ColorPreset.Transparent:
            return(Color.clear);

        case ColorPreset.Alpha80:
            return(new Color(0, 0, 0, 0.8f));

        default:
            return(Color.white);
        }
    }
Example #8
0
        public MenuColors(ColorPreset preset)
        {
            switch (preset)
            {
            case ColorPreset.Cyberpunk:
                Hightlight     = ConsoleColor.Cyan;
                Text           = ConsoleColor.Black;
                Border         = ConsoleColor.DarkCyan;
                TitleHighlight = ConsoleColor.DarkMagenta;
                break;

            case ColorPreset.Sprite:
                Hightlight     = ConsoleColor.Green;
                Text           = ConsoleColor.Black;
                Border         = ConsoleColor.DarkGreen;
                TitleHighlight = ConsoleColor.DarkYellow;
                break;

            case ColorPreset.Monochrome:
                Hightlight     = ConsoleColor.Gray;
                Text           = ConsoleColor.Black;
                Border         = ConsoleColor.DarkGray;
                TitleHighlight = ConsoleColor.DarkGray;
                break;

            case ColorPreset.Patriotic:
                Hightlight     = ConsoleColor.Red;
                Text           = ConsoleColor.White;
                Border         = ConsoleColor.DarkBlue;
                TitleHighlight = ConsoleColor.Blue;
                break;
            }
        }
Example #9
0
 public Display(string title, int rows, ColorPreset colorPreset)
 {
     screenWidth  = Console.WindowWidth;
     screenHeight = Console.WindowHeight;
     this.title   = title;
     halfRows     = (rows + 1) / 2;
     menuColor    = new MenuColors(colorPreset);
 }
    private void Awake()
    {
        //InvokeRepeating("Randomize", 1f,0.5f);
        Randomize();

        if (useColorPreset && !colorPreset)
        {
            colorPreset = ManagerIndex.MI.ColorManager.GetRandomPreset();
        }
    }
Example #11
0
        public void DrawString(double x, double y, string Text, double fontSize, ColorPreset color)
        {
            InitPageOffset(ref y);

            using (XGraphics gfx = XGraphics.FromPdfPage(currentPage))
            {
                XFont font = new XFont(defaultFontName, defaultFontSize, XFontStyle.Regular);
                gfx.DrawString(Text, font, XBrushes.Navy, x, y, XStringFormats.BottomCenter);
            }
        }
Example #12
0
        public void FillEllipse(double x1, double y1, double w, double h, ColorPreset FillColor, ColorValue BorderColor)
        {
            var fillColorValue = GetPresetBrush(FillColor);

            this.FillEllipse(x1, y1, w, h,
                             new ColorValue {
                A = fillColorValue.Color.A, R = fillColorValue.Color.R, G = fillColorValue.Color.G, B = fillColorValue.Color.B
            },
                             BorderColor
                             );
        }
Example #13
0
        public void Reload()
        {
            Logger.log.Notice("Reloading TwitchFX config");

            Command.ResetCommands();

            LoadConfig();

            ColorPreset.ResetColorPresets();
            CustomLightshowData.ResetLightshows();

            LoadColorPresets(UnityGame.UserDataPath + "\\TwitchFX\\ColorPresets");
            LoadLightshows(UnityGame.UserDataPath + "\\TwitchFX\\Lightshows");
        }
Example #14
0
        public void FillEllipse(double x, double y, double w, double h, ColorPreset FillColor, ColorPreset BorderColor)
        {
            var fillColorValue   = GetPresetBrush(FillColor);
            var strokeColorValue = GetPresetBrush(BorderColor);

            this.FillEllipse(x, y, w, h,
                             new ColorValue {
                A = fillColorValue.Color.A, R = fillColorValue.Color.R, G = fillColorValue.Color.G, B = fillColorValue.Color.B
            },
                             new ColorValue {
                A = strokeColorValue.Color.A, R = strokeColorValue.Color.R, G = strokeColorValue.Color.G, B = strokeColorValue.Color.B
            }
                             );
        }
Example #15
0
        private void LoadColorPresets(string colorPresetFolderPath)
        {
            if (!Directory.Exists(colorPresetFolderPath))
            {
                Directory.CreateDirectory(colorPresetFolderPath);
            }

            string[] colorPresetFilePaths = Directory.GetFiles(colorPresetFolderPath);

            foreach (string colorPresetFilePath in colorPresetFilePaths)
            {
                string name = Path.GetFileName(colorPresetFilePath);

                if (!name.EndsWith(".json"))
                {
                    continue;
                }

                name = name.Substring(0, name.Length - 5);

                string json = File.ReadAllText(colorPresetFilePath);

                JSONNode rootJSON;

                try {
                    rootJSON = JSON.Parse(json);
                } catch (Exception e) {
                    Logger.log.Error("Failed loading color preset: " + name);
                    Logger.log.Error("\t" + e.Message);

                    continue;
                }

                ColorPreset colorPreset;

                try {
                    colorPreset = ColorPreset.LoadColorPresetFromJSON(rootJSON);
                } catch (InvalidJSONException e) {
                    Logger.log.Error("Failed loading color preset: " + name);
                    Logger.log.Error("\tInvalid JSON data: " + e.errorMessage);

                    continue;
                }

                ColorPreset.SetColorPreset(name, colorPreset);
            }

            Logger.log.Info(ColorPreset.GetColorPresetCount() + " color presets loaded from " + colorPresetFolderPath);
        }
Example #16
0
        public void FillRectangle(double x, double y, double w, double h, ColorPreset FillColor, ColorPreset BorderColor)
        {
            Rectangle rect = new Rectangle();

            rect.Width  = w;
            rect.Height = h;

            rect.Fill   = GetPresetBrush(FillColor);
            rect.Stroke = GetPresetBrush(BorderColor);

            Canvas.SetTop(rect, y);
            Canvas.SetLeft(rect, x);

            canvas.Children.Add(rect);
        }
Example #17
0
    private Color ColorPresetToColor(ColorPreset preset)
    {
        switch (preset)
        {
        case ColorPreset.颜色1:
            return(the颜色预设.颜色1);

        case ColorPreset.颜色2:
            return(the颜色预设.颜色1);

        case ColorPreset.颜色3:
            return(the颜色预设.颜色1);
        }
        return(Color.black);
    }
Example #18
0
 public void SetColorPreset(ColorPreset nColorPreset)
 {
     primary          = nColorPreset.primary;
     secondary        = nColorPreset.secondary;
     leatherPrimary   = nColorPreset.leatherPrimary;
     metalPrimary     = nColorPreset.metalPrimary;
     leatherSecondary = nColorPreset.leatherSecondary;
     metalDark        = nColorPreset.metalDark;
     metalSecondary   = nColorPreset.metalSecondary;
     hair             = nColorPreset.hair;
     skin             = nColorPreset.skin;
     scar             = nColorPreset.scar;
     bodyArt          = nColorPreset.bodyArt;
     eyes             = nColorPreset.eyes;
     ApplyColors();
 }
        /// <summary>
        /// Sets up range sprites for current map.
        /// </summary>
        private void SetupRanges()
        {
            var scoreProcessor = Model.GetScoreProcessor();
            var rankRangeTypes = Model.GetRankRangeTypes().ToList();

            for (int i = 0; i < rankRangeTypes.Count; i++)
            {
                var   rank    = rankRangeTypes[i];
                float accFrom = scoreProcessor.GetRankAccuracy(rank);
                float accTo   = (
                    i == rankRangeTypes.Count - 1 ?
                    1f :
                    scoreProcessor.GetRankAccuracy(rankRangeTypes[i + 1])
                    );
                SetRangeSprite(rangeSprites[i], ColorPreset.GetRankColor(rank), accFrom, accTo);
            }
        }
Example #20
0
        public void DrawString(double x, double y, string text, double size, ColorPreset color)
        {
            y += textYOffset;

            TextBlock t = new TextBlock();

            t.Name         = Guid.NewGuid().ToString();
            t.TextWrapping = TextWrapping.Wrap;
            t.FontSize     = size;
            t.Text         = text;
            t.Foreground   = GetPresetBrush(color);
            t.FontFamily   = TitleFont;

            Canvas.SetTop(t, y);
            Canvas.SetLeft(t, x);

            canvas.Children.Add(t);
        }
Example #21
0
    //set a color preset
    private bool SetColor(ColorPreset preset)
    {
        if (isTransitioning)
        {
            //we either ignore this preset or add it to our queue
            DebugManager.dm.Out("ColorManager: Refused attempt to apply " +
                                "two presets simultaniously. Add to queue is " + allowQueue);

            if (allowQueue)
            {
                presetQueue.Add(preset);
            }

            return(false);
        }
        else
        {
            //we apply the color preset
            StartCoroutine(ApplyPresetColor(preset));
            return(true);
        }
    }
        //mxd
        private void ApplyColorPreset(ColorPreset preset)
        {
            switch (preset)
            {
            case ColorPreset.DOOM:
                ColorSingleSided    = new PixelColor(255, 252, 0, 0);
                ColorSecret         = new PixelColor(255, 255, 0, 255);
                ColorFloorDiff      = new PixelColor(255, 188, 120, 72);
                ColorCeilDiff       = new PixelColor(255, 252, 252, 0);
                ColorHiddenFlag     = new PixelColor(255, 192, 192, 192);
                ColorInvisible      = new PixelColor(255, 192, 192, 192);
                ColorMatchingHeight = new PixelColor(255, 108, 108, 108);
                ColorBackground     = new PixelColor(255, 0, 0, 0);
                break;

            case ColorPreset.HEXEN:
                ColorSingleSided    = new PixelColor(255, 89, 64, 27);
                ColorSecret         = new PixelColor(255, 255, 0, 255);
                ColorFloorDiff      = new PixelColor(255, 208, 176, 133);
                ColorCeilDiff       = new PixelColor(255, 103, 59, 31);
                ColorHiddenFlag     = new PixelColor(255, 192, 192, 192);
                ColorInvisible      = new PixelColor(255, 108, 108, 108);
                ColorMatchingHeight = new PixelColor(255, 108, 108, 108);
                ColorBackground     = new PixelColor(255, 163, 129, 84);
                break;

            case ColorPreset.STRIFE:
                ColorSingleSided    = new PixelColor(255, 199, 195, 195);
                ColorSecret         = new PixelColor(255, 255, 0, 255);
                ColorFloorDiff      = new PixelColor(255, 55, 59, 91);
                ColorCeilDiff       = new PixelColor(255, 108, 108, 108);
                ColorHiddenFlag     = new PixelColor(255, 0, 87, 130);
                ColorInvisible      = new PixelColor(255, 192, 192, 192);
                ColorMatchingHeight = new PixelColor(255, 112, 112, 160);
                ColorBackground     = new PixelColor(255, 0, 0, 0);
                break;
            }
        }
Example #23
0
    //update ingame color using a color preset, do not call directly
    private IEnumerator ApplyPresetColor(ColorPreset preset)
    {
        isTransitioning = true;
        float t    = 0;
        float step = lerpStepSize;

        while (t < 1)
        {
            for (int i = 0; i < preset.materials.Length; i++)
            {
                preset.materials[i].color = Color.Lerp(preset.materials[i].color, preset.materialColors[i], t);
                lightSource.color         = Color.Lerp(lightSource.color, preset.lightningColor, t);
            }

            t += step;
            yield return(new WaitForSeconds(lerpSmoothness));
        }
        t = 0;

        isTransitioning = false;

        DebugManager.dm.Out("ColorManager: Applied color preset " + preset.presetName);
    }
Example #24
0
    /// <summary>
    /// 돌 표시
    /// </summary>
    /// <param name="color"></param>
    /// <param name="showAnim"></param>
    public void Show(ColorPreset color, bool showAnim)
    {
        m_image.enabled = true;

        if (m_animCo != null)                                           // 애니메이션 실행중인 게 있으면 취소
        {
            StopCoroutine(m_animCo);
        }

        var realColor = c_colorDict[color];

        m_image.color = realColor;

        System.Action finalSetFunc = () =>
        {
            m_imageTr.anchoredPosition = Vector2.zero;
            m_image.color = realColor;
        };

        if (showAnim)                                                           // 애니메이션 재생하는 경우
        {
            m_animCo = this.StartLerpingCoroutine(0.2f, (t) =>
            {
                m_imageTr.anchoredPosition = new Vector2(0, (1f - t) * 100);
                var c         = m_image.color;
                c.a           = t;
                m_image.color = c;
            }, finalSetFunc);
        }
        else
        {                                                                                       // 애니메이션 재생하지 않는 경우, 마지막 상태로 바로 세팅
            m_animCo = null;
            finalSetFunc();
        }

        HideBackEffect();
    }
Example #25
0
 private void InitColorPresets()
 {
     if (m_colorPresets == null)
     {
         m_colorPresets    = new ColorPreset[6];
         m_colorPresets[0] = new ColorPreset()
         {
             Name  = "Yellow".Localize(),
             Color = SystemColors.Info
         };
         m_colorPresets[1] = new ColorPreset()
         {
             Name  = "Blue".Localize(),
             Color = Color.LightSkyBlue
         };
         m_colorPresets[2] = new ColorPreset()
         {
             Name  = "Green".Localize(),
             Color = Color.FromArgb(178, 255, 161)
         };
         m_colorPresets[3] = new ColorPreset()
         {
             Name  = "Pink".Localize(),
             Color = Color.LightPink
         };
         m_colorPresets[4] = new ColorPreset()
         {
             Name  = "Purple".Localize(),
             Color = Color.FromArgb(182, 202, 255)
         };
         m_colorPresets[5] = new ColorPreset()
         {
             Name  = "Gray".Localize(),
             Color = Color.LightGray
         };
     }
 }
        protected override void Execute(string[] args)
        {
            string name = args[0];

            float?duration = TryParseFloat(args, 1);

            ColorPreset preset = ColorPreset.GetColorPreset(name);

            if (preset == null)
            {
                Plugin.chat.Send("Preset with name " + name + " not found");

                return;
            }

            if (preset.leftLightColor.HasValue || preset.rightLightColor.HasValue)
            {
                LightController.instance.SetColors(preset.leftLightColor, preset.rightLightColor);
                LightController.instance.SetLightMode(LightMode.Custom, duration);
            }

            if (preset.leftNoteColor.HasValue || preset.rightNoteColor.HasValue)
            {
                ColorController.instance.SetNoteColors(preset.leftNoteColor, preset.rightNoteColor, duration);
            }

            if (preset.leftSaberColor.HasValue || preset.rightSaberColor.HasValue)
            {
                ColorController.instance.SetSaberColors(preset.leftSaberColor, preset.rightSaberColor, duration);
            }

            if (preset.wallColor.HasValue)
            {
                ColorController.instance.SetWallColor(preset.wallColor.Value, duration);
            }
        }
Example #27
0
 private CustomLightshowData(BeatmapEventData[] beatmapEvents, ColorPreset colorPreset)
 {
     this.beatmapEvents = beatmapEvents;
     this.colorPreset   = colorPreset;
 }
 private static void _ApplyColor(UILabel targetLabel, ColorPreset preset)
 {
     Tools_LabelStyle._ResetLabel(targetLabel);
     targetLabel.color         = preset.color;
     targetLabel.applyGradient = false;
 }
Example #29
0
        private void ColorSelectorWindow(int WindowID)
        {
            GUI.enabled = true;

            GUILayout.BeginHorizontal();
            {
                GUI.enabled = false;
                GUILayout.Button("-KK-", UIMain.DeadButton, GUILayout.Height(21));

                GUILayout.FlexibleSpace();

                GUILayout.Button(titleText, UIMain.DeadButton, GUILayout.Height(21));

                GUILayout.FlexibleSpace();

                GUI.enabled = true;

                if (GUILayout.Button("X", UIMain.DeadButtonRed, GUILayout.Height(21)))
                {
                    //KerbalKonstructs.instance.saveObjects();
                    this.Close();
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(1);
            GUILayout.Box(UIMain.tHorizontalSep, UIMain.BoxNoBorder, GUILayout.Height(4));



            scrollPointer = GUILayout.BeginScrollView(scrollPointer);
            {
                foreach (ColorPreset preset in colors2Display)
                {
                    GUI.enabled = (selectedPreset != preset);
                    if (GUILayout.Button(preset.name))
                    {
                        selectedPreset = preset;
                        callBack.Invoke(selectedPreset.color, selectedPreset.texture);
                        this.Close();
                    }
                }
                GUI.enabled = true;
            }
            GUILayout.EndScrollView();
            GUI.enabled = true;
            GUILayout.BeginHorizontal();
            {
                //if (GUILayout.Button("OK", GUILayout.Height(23)))
                //{
                //    callBack.Invoke(selectedPreset.color, selectedPreset.texture);
                //    this.Close();
                //}
                if (GUILayout.Button("Cancel", GUILayout.Height(23)))
                {
                    this.Close();
                }
            }
            GUILayout.EndHorizontal();

            GUI.DragWindow(new Rect(0, 0, 10000, 10000));
        }
Example #30
0
        public void Start()
        {
            foreach (LightEffectController light in lights)
            {
                light.Reset();
            }

            LightController.instance.ClearLights();

            LightRotationController.instance.ResetCustomLightRotation();
            RingController.instance.ResetCustomRingRotation();

            ColorPreset preset = lightshowData.colorPreset;

            if (preset != null)
            {
                if (!skipSetRestore)
                {
                    ColorController.instance.SetRestoreValues(this);
                }

                ColorController.instance.StopIntercept();

                if (preset.leftNoteColor.HasValue || preset.rightNoteColor.HasValue)
                {
                    ColorController.instance.SetNoteColors(preset.leftNoteColor, preset.rightNoteColor);
                }

                if (preset.leftSaberColor.HasValue || preset.rightSaberColor.HasValue)
                {
                    ColorController.instance.SetSaberColors(preset.leftSaberColor, preset.rightSaberColor);
                }

                if (preset.wallColor.HasValue)
                {
                    ColorController.instance.SetWallColor(preset.wallColor.Value);
                }

                ColorController.instance.StartIntercept(this);

                Color leftColor  = preset.leftLightColor ?? (restoreMode == LightMode.Custom ? LightController.instance.customColorLeft : colorScheme.environmentColor0);
                Color rightColor = preset.rightLightColor ?? (restoreMode == LightMode.Custom ? LightController.instance.customColorRight : colorScheme.environmentColor1);

                foreach (LightEffectController light in lights)
                {
                    light.SetColors(leftColor, rightColor);
                }
            }
            else if (restoreMode == LightMode.Custom)
            {
                foreach (LightEffectController light in lights)
                {
                    light.SetColors(LightController.instance.customColorLeft, LightController.instance.customColorRight);
                }
            }
            else
            {
                foreach (LightEffectController light in lights)
                {
                    light.SetColors(colorScheme.environmentColor0, colorScheme.environmentColor1);
                }
            }
        }
 private void InitColorPresets()
 {
     if (m_colorPresets == null)
     {
         m_colorPresets = new ColorPreset[6];
         m_colorPresets[0] = new ColorPreset()
             {
                 Name = "Yellow".Localize(),
                 Color = SystemColors.Info
             };
         m_colorPresets[1] = new ColorPreset()
             {
                 Name = "Blue".Localize(),
                 Color = Color.LightSkyBlue
             };
         m_colorPresets[2] = new ColorPreset()
             {
                 Name = "Green".Localize(),
                 Color = Color.FromArgb(178, 255, 161)
             };
         m_colorPresets[3] = new ColorPreset()
             {
                 Name = "Pink".Localize(),
                 Color = Color.LightPink
             };
         m_colorPresets[4] = new ColorPreset()
             {
                 Name = "Purple".Localize(),
                 Color = Color.FromArgb(182, 202, 255)
             };
         m_colorPresets[5] = new ColorPreset()
             {
                 Name = "Gray".Localize(),
                 Color = Color.LightGray
             };
     }
 }