Overview
Kore provides a unified Color API that covers three families of colors used by Minecraft:
FormattingColorandBossBarColor(named colors for chat, UI, teams, etc.)RGBandARGB(numeric colors)DyeColors(the 16 dye colors used by entities and items)
For the vanilla reference on color behavior, see the Minecraft Wiki’s Color page (https://minecraft.wiki/w/Color).
Color types in Kore
Color(sealed interface): umbrella type accepted by most helpers.FormattingColor: named chat/formatting colors (e.g.Color.RED,Color.AQUA).BossBarColor: bossbar’s named colors.RGB/ARGB: numeric colors.RGBis#rrggbb,ARGBis#aarrggbb.DyeColors: 16 dye colors (white, orange, magenta, …, black) for collars, shulkers, sheep, tropical fish, etc.
Helpers to create numeric colors:
Conversions and utils:
Random colors
Kore provides static random() helpers on the color classes to simplify testing and procedural generation. You can also use a Random instance to generate random colors with a specific seed.
These helpers are available on:
RGB:RGB.random(random: Random = Random): returns a random RGBARGB:ARGB.random(random: Random = Random, alpha: Boolean = false): returns a random ARGB; setalpha = trueto randomize the alpha channelFormattingColor:FormattingColor.random(random: Random = Random): returns a random named formatting colorBossBarColor:BossBarColor.random(random: Random = Random): returns a random named bossbar color
Example usage:
These helpers were added to make it easy to generate example content, tests, or procedurally-generated visuals.
Serialization formats by context
Different Minecraft systems expect colors in different formats. Kore picks the right format automatically via serializers.
-
Chat components (
color,shadow_color): string- Named colors emit lowercase names (e.g.
"red"). RGBemits"#rrggbb";ARGBemits"#aarrggbb".
- Named colors emit lowercase names (e.g.
-
Item components (decimal ints):
dyedColor(..): decimal (or object withrgbdecimal when tooltip flag is present) See on GitHubmapColor(..): decimal See on GitHubpotionContents(customColor=..): decimal See on GitHub- Firework explosion
colors/fade_colors: decimal list See on GitHub
-
Worldgen Biomes (decimal ints): See on GitHub
-
Particles:
- Command particles (decimal ints): Dust, DustColorTransition, Trail See on GitHub See on GitHub See on GitHub
- Enchantment effect particles (double arrays
[r, g, b]in 0..1): See on GitHub See on GitHub See on GitHub
-
UI and commands using named colors (strings):
- Teams, Scoreboards, Bossbar:
FormattingColor/BossBarColorSee on GitHub See on GitHub
- Teams, Scoreboards, Bossbar:
Dye colors and where they’re used
DyeColors are used for entity variants and certain item/entity data components:
catCollar(..),wolfCollar(..),sheepColor(..),shulkerColor(..)See on GitHub See on GitHub See on GitHub See on GitHub
Practical examples
Chat components (string serialization):
Dyed leather color (decimal serialization):
Map color (decimal serialization):
Fireworks (decimal lists):
Biome effects (decimal):
Particles
-
Command dust (decimal):
-
Enchantment dust (double array):
Entity variant dye usage:
Notes
- Passing
Colorto component helpers that use decimal or double-array formats is safe: Kore converts automatically viatoRGB(). - Use
DyeColorswhen the game mechanic expects a dye color (collars, sheep, shulkers, tropical fish), andFormattingColor/BossBarColorfor chat/UI tints.
Further reading
- Minecraft Wiki — Color:
https://minecraft.wiki/w/Color
