ColorBrewer

Create color blind friendly color palettes in Java.

Лицензия

Лицензия

Категории

Категории

BioJava Прикладные библиотеки Science
Группа

Группа

org.biojava
Идентификатор

Идентификатор

jcolorbrewer
Последняя версия

Последняя версия

5.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

ColorBrewer
Create color blind friendly color palettes in Java.
Система контроля версий

Система контроля версий

https://github.com/rcsb/colorbrewer

Скачать jcolorbrewer

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.biojava/jcolorbrewer/ -->
<dependency>
    <groupId>org.biojava</groupId>
    <artifactId>jcolorbrewer</artifactId>
    <version>5.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.biojava/jcolorbrewer/
implementation 'org.biojava:jcolorbrewer:5.2'
// https://jarcasting.com/artifacts/org.biojava/jcolorbrewer/
implementation ("org.biojava:jcolorbrewer:5.2")
'org.biojava:jcolorbrewer:jar:5.2'
<dependency org="org.biojava" name="jcolorbrewer" rev="5.2">
  <artifact name="jcolorbrewer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.biojava', module='jcolorbrewer', version='5.2')
)
libraryDependencies += "org.biojava" % "jcolorbrewer" % "5.2"
[org.biojava/jcolorbrewer "5.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Colorbrewer

Build Status Version License

Create color blind friendly color palettes in Java.

The color palettes provided by this library are based on the colors provided by the [color brewer project] (http://colorbrewer.org/),

In principle there are three types of palettes provided:

  • Sequential example

  • Diverging example

  • Qualitative example

For each palette any number of steps (=colors) in the palette can be requested.

How to Use

Show a user Dialog

	final ColorPaletteChooserDialog dialog = new ColorPaletteChooserDialog();
	dialog.show();
	if(dialog.wasOKPressed()) {
		Color c = dialog.getColor();
	}

will display this dialog:

Screenshot of a ColorPaletteChooserDIalog

Create a palette programmatically

Get a color palette with a specific number of color:

	boolean colorBlindSave = true;
		ColorBrewer[] sequentialPalettes = ColorBrewer.getSequentialColorPalettes(colorBlindSave);	


		ColorBrewer myBrewer = sequentialPalettes[0];

		System.out.println( "Name of this color brewer: " + myBrewer);

		// I want a gradient of 8 colors:
		Color[] myGradient = myBrewer.getColorPalette(8);

		// These are the color codes:
		for (Color color: myGradient){
			// convert to hex for web display:
			String hex = Integer.toHexString(color.getRGB() & 0xffffff);			
			System.out.println("#"+hex+";");
		}
		
		return myGradient;
	
	

This provides the following 8 blue colors: The 'Blues' color palette

Installation

This project is now hosted on Maven Central. You can install the jar file by adding this to your project configuration:

<dependencies>
 <dependency>
  <groupId>org.biojava</groupId>
  <artifactId>jcolorbrewer</artifactId>
  <version>5.2</version>
 </dependency>
</dependencies>

Example Application

Here we are coloring the various components of the virus structure of the human poliovirus ( PDB ID 3J69 ) .

PDB ID 3J69

Acknowledgments

Colors from www.ColorBrewer.org by Cynthia A. Brewer, Geography, Pennsylvania State University.

org.biojava

RCSB PDB

Github repository of the RCSB Protein Data Bank

Версии библиотеки

Версия
5.2