-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alex
committed
Mar 6, 2022
1 parent
c847576
commit 911a4f1
Showing
5 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package app; | ||
|
||
import misc.Misc; | ||
|
||
/** | ||
* Класс цветов | ||
*/ | ||
public class Colors { | ||
/** | ||
* цвет фона | ||
*/ | ||
public static final int APP_BACKGROUND_COLOR = Misc.getColor(255, 38, 70, 83); | ||
|
||
/** | ||
* Запрещённый конструктор | ||
*/ | ||
private Colors() { | ||
throw new AssertionError("Вызов этого конструктора запрещён"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package misc; | ||
|
||
/** | ||
* Вспомогательная библиотека | ||
*/ | ||
public class Misc { | ||
|
||
/** | ||
* Получить цвет по компонентам | ||
* | ||
* @param a прозрачность | ||
* @param r красная компонента | ||
* @param g зелёная компонента | ||
* @param b синяя компонента | ||
* @return целове число с цветом | ||
*/ | ||
public static int getColor(int a, int r, int g, int b) { | ||
return ((a * 256 + r) * 256 + g) * 256 + b; | ||
} | ||
|
||
|
||
/** | ||
* Запрещаем вызов конструктора | ||
*/ | ||
private Misc() { | ||
throw new AssertionError("Вызов этого конструктора запрещён"); | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.