package org.hunmr.options;

import com.intellij.openapi.components.*;
import com.intellij.openapi.project.Project;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jetbrains.annotations.Nullable;

import java.awt.*;

@State(
        name = "emacsIDEAsPluginConfig",
        storages = {
                @Storage(
                        id = "other",
                        file = "$APP_CONFIG$/emacsIDEAs_plugin.xml")
        }
)
public class PluginConfig implements PersistentStateComponent<PluginConfig> {
    public int _firstJumpBackground = Color.white.getRGB();
    public int _firstJumpForeground = Color.red.getRGB();
    public int _secondJumpBackground = Color.white.getRGB();
    public int _secondJumpForeground = Color.blue.getRGB();
    public boolean _needSelectTextAfterJump = true;

    public Color getFirstJumpBackground() {
        return new Color(_firstJumpBackground);
    }

    public Color getFirstJumpForeground() {
        return new Color(_firstJumpForeground);
    }

    public Color getSecondJumpBackground() {
        return new Color(_secondJumpBackground);
    }

    public Color getSecondJumpForeground() {
        return new Color(_secondJumpForeground);
    }

    @Nullable
    @Override
    public PluginConfig getState() {
        return this;
    }

    @Override
    public void loadState(PluginConfig config) {
        XmlSerializerUtil.copyBean(config, this);
    }

    @Nullable
    public static PluginConfig getInstance(Project project) {
        return ServiceManager.getService(project, PluginConfig.class);
    }

}

@@ -550,36 +550,35 @@
 kground = Color.
-whit
+blu
 e.getRGB();%0A    
@@ -621,11 +621,13 @@
 lor.
-red
+white
 .get
@@ -670,37 +670,35 @@
 kground = Color.
-white
+red
 .getRGB();%0A    p
@@ -729,35 +729,36 @@
 eground = Color.
-blu
+whit
 e.getRGB();%0A    

align marker color with avy-jump in emacs