feat: add more language color
This commit is contained in:
2 files changed
+12
-4
No files matched your search
@@ -36,7 +36,7 @@ object GitHubParseCommand {
|
|||||||
private val forkIcon = ImageIO.read(Resources.loadFromResources("github/fork.png"))
|
private val forkIcon = ImageIO.read(Resources.loadFromResources("github/fork.png"))
|
||||||
private val customFont = Font("Serif", Font.ITALIC, 50).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
private val customFont = Font("Serif", Font.ITALIC, 50).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
||||||
private val titleCustomFont = Font("Serif", Font.ITALIC, 75).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
private val titleCustomFont = Font("Serif", Font.ITALIC, 75).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
||||||
private val descriptionCustomFont = Font("Serif", Font.ITALIC, 50).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
private val descriptionCustomFont = Font("Serif", Font.ITALIC, 40).deriveFont(Font.ITALIC).deriveFont(Font.BOLD)
|
||||||
|
|
||||||
private val languageColors = mapOf(
|
private val languageColors = mapOf(
|
||||||
"Kotlin" to Color(169, 123, 255),
|
"Kotlin" to Color(169, 123, 255),
|
||||||
@@ -49,6 +49,14 @@ object GitHubParseCommand {
|
|||||||
"PHP" to Color(79, 93, 149),
|
"PHP" to Color(79, 93, 149),
|
||||||
"TypeScript" to Color(43, 116, 137),
|
"TypeScript" to Color(43, 116, 137),
|
||||||
"Swift" to Color(240, 81, 56),
|
"Swift" to Color(240, 81, 56),
|
||||||
|
"SCSS" to Color(198, 83, 140),
|
||||||
|
"Visual Basic 6.0" to Color(44, 99, 83),
|
||||||
|
"Astro" to Color(255, 90, 3),
|
||||||
|
"Rust" to Color(222, 165, 132),
|
||||||
|
"PowerShell" to Color(1, 36, 86),
|
||||||
|
"MDX" to Color(252, 179, 44),
|
||||||
|
"Shell" to Color(137, 224, 81),
|
||||||
|
"CMake" to Color(218, 52, 52),
|
||||||
"Unknown" to Color(211, 211, 211)
|
"Unknown" to Color(211, 211, 211)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -96,8 +104,8 @@ object GitHubParseCommand {
|
|||||||
val truncatedFullNameText = setTruncat(repoStat.fullName, g2d, 1000)
|
val truncatedFullNameText = setTruncat(repoStat.fullName, g2d, 1000)
|
||||||
g2d.drawString(truncatedFullNameText, 80, 280)
|
g2d.drawString(truncatedFullNameText, 80, 280)
|
||||||
g2d.font = descriptionCustomFont
|
g2d.font = descriptionCustomFont
|
||||||
val truncatedDescription = setTruncat(repoStat.description, g2d, 1000)
|
val truncatedDescription = setTruncat(repoStat.description ?: "暂无描述~", g2d, 1000)
|
||||||
g2d.drawString(truncatedDescription, 20, 450)
|
g2d.drawString(truncatedDescription, 80, 450)
|
||||||
val avatarImage = ImageIO.read(URI(repoStat.owner.avatarUrl).toURL())
|
val avatarImage = ImageIO.read(URI(repoStat.owner.avatarUrl).toURL())
|
||||||
g2d.drawCustomImage(avatarImage, 1200, 300, 300.0, 300.0, true)
|
g2d.drawCustomImage(avatarImage, 1200, 300, 300.0, 300.0, true)
|
||||||
val byteArrayOutputStream = ByteArrayOutputStream()
|
val byteArrayOutputStream = ByteArrayOutputStream()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ data class RepoInfo(
|
|||||||
val owner: Owner,
|
val owner: Owner,
|
||||||
@SerializedName("full_name")
|
@SerializedName("full_name")
|
||||||
val fullName: String,
|
val fullName: String,
|
||||||
val description: String,
|
val description: String?,
|
||||||
@SerializedName("forks_count")
|
@SerializedName("forks_count")
|
||||||
val forksCount: Int,
|
val forksCount: Int,
|
||||||
val language: String,
|
val language: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user