onbeforeunload в Opera

Вот решение в Java для Android на основе

https://stackoverflow.com/users/815724/peter-o

 // Put this method in whichever class you deem appropriate
    // static or non-static, up to you.
    public static int getContrastColor(int colorIntValue) {
        int red = Color.red(colorIntValue);
        int green = Color.green(colorIntValue);
        int blue = Color.blue(colorIntValue);
        double lum = (((0.299 * red) + ((0.587 * green) + (0.114 * blue))));
        return lum > 186 ? 0xFF000000 : 0xFFFFFFFF;
    }

    // Usage
    // If Color is represented as HEX code:
    String colorHex = "#484588";
    int color = Color.parseColor(colorHex);

    // Or if color is Integer:
    int color = 0xFF484588;

    // Get White (0xFFFFFFFF) or Black (0xFF000000)
    int contrastColor = WhateverClass.getContrastColor(color);
12
задан Community 23 May 2017 в 12:34
поделиться

1 ответ

Вы попробовали это?

history.navigationMode = 'compatible';

Ссылка, найденная через эту страницу

Я на самом деле не попробовал его сам, но это выглядит многообещающим.

1
ответ дан 2 December 2019 в 19:56
поделиться
Другие вопросы по тегам:

Похожие вопросы: