File indexing completed on 2024-12-29 05:06:01

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 // from https://invent.kde.org/plasma/plasma-pa/-/blob/master/applet/contents/code/icon.js
0008 function name(volume, muted, prefix) {
0009     if (!prefix) {
0010         prefix = "audio-volume";
0011     }
0012     var icon = null;
0013     var percent = volume / 100;
0014     if (percent <= 0.0 || muted) {
0015         icon = prefix + "-muted";
0016     } else if (percent <= 0.25) {
0017         icon = prefix + "-low";
0018     } else if (percent <= 0.75) {
0019         icon = prefix + "-medium";
0020     } else {
0021         icon = prefix + "-high";
0022     }
0023     return icon;
0024 }
0025