Class ColorBlindColorScheme
java.lang.Object
org.pushingpixels.radiance.theming.api.colorscheme.BaseColorScheme
org.pushingpixels.radiance.tools.themingdebugger.ColorBlindColorScheme
- All Implemented Interfaces:
RadianceColorScheme
,SchemeBaseColors
,SchemeDerivedColors
,RadianceTrait
- Direct Known Subclasses:
DeuteranopiaColorScheme
,ProtanopiaColorScheme
,TritanopiaColorScheme
Base class for color schemes simulating color-blind users.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptiondouble[][]
Matrix for converting LMS to RGB.double[][]
Matrix for converting RGB to LMS.private Color
The foreground color.private Color
The main dark color.private Color
The main extra-light color.private Color
The main light color.private Color
The main medium color.private Color
The main ultra-dark color.private Color
The main ultra-light color.private RadianceColorScheme
The original color scheme.Fields inherited from class org.pushingpixels.radiance.theming.api.colorscheme.BaseColorScheme
displayName, isDark
-
Constructor Summary
ConstructorsConstructorDescriptionColorBlindColorScheme
(RadianceColorScheme origScheme, ColorBlindColorScheme.BlindnessKind kind) Creates a new color scheme that simulates color-blindness. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Color
getColorBlindColor
(Color orig, double[][] rgbToLms, ColorBlindColorScheme.BlindnessKind kind, double[][] lmsToRgb) Converts the specified color into color-blind version.Retrieves the dark color.Retrieves the extra color.Retrieves the foreground color.Retrieves the light color.Retrieves the medium color.Returns the original color scheme.Retrieves the ultra-dark color.Retrieves the ultra-light color.private static double[]
mult3
(double[][] matrix, double[] vector) Multiplies the specified 3x3 matrix by the specified 3x1 vector.Methods inherited from class org.pushingpixels.radiance.theming.api.colorscheme.BaseColorScheme
blendWith, getAccentedBackgroundFillColor, getBackgroundFillColor, getDisplayName, getEchoColor, getFocusRingColor, getLineColor, getMarkColor, getSelectionBackgroundColor, getSelectionForegroundColor, getSeparatorPrimaryColor, getSeparatorSecondaryColor, getTextBackgroundFillColor, hueShift, invert, isDark, named, negate, saturate, shade, shift, shiftBackground, tint, tone, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.pushingpixels.radiance.theming.api.colorscheme.RadianceColorScheme
getColorFilter
Methods inherited from interface org.pushingpixels.radiance.theming.api.colorscheme.SchemeBaseColors
toImage
-
Field Details
-
_rgbToLms
public double[][] _rgbToLmsMatrix for converting RGB to LMS. -
_lmsToRgb
public double[][] _lmsToRgbMatrix for converting LMS to RGB. -
mainUltraLightColor
The main ultra-light color. -
mainExtraLightColor
The main extra-light color. -
mainLightColor
The main light color. -
mainMidColor
The main medium color. -
mainDarkColor
The main dark color. -
mainUltraDarkColor
The main ultra-dark color. -
foregroundColor
The foreground color. -
origScheme
The original color scheme.
-
-
Constructor Details
-
ColorBlindColorScheme
public ColorBlindColorScheme(RadianceColorScheme origScheme, ColorBlindColorScheme.BlindnessKind kind) Creates a new color scheme that simulates color-blindness.- Parameters:
origScheme
- Original color scheme.kind
- Color-blindness kind.
-
-
Method Details
-
getColorBlindColor
private static Color getColorBlindColor(Color orig, double[][] rgbToLms, ColorBlindColorScheme.BlindnessKind kind, double[][] lmsToRgb) Converts the specified color into color-blind version.- Parameters:
orig
- The original color.rgbToLms
- RGB to LMS conversion matrix.kind
- Color-blindness kind.lmsToRgb
- LMS to RGB conversion matrix.- Returns:
- Color-blind version of the original color.
-
mult3
private static double[] mult3(double[][] matrix, double[] vector) Multiplies the specified 3x3 matrix by the specified 3x1 vector.- Parameters:
matrix
- Matrix.vector
- Vector.- Returns:
- Vector multiplication.
-
getForegroundColor
Description copied from interface:SchemeBaseColors
Retrieves the foreground color.- Returns:
- Foreground color.
-
getUltraLightColor
Description copied from interface:SchemeBaseColors
Retrieves the ultra-light color.- Returns:
- Ultra-light color.
-
getExtraLightColor
Description copied from interface:SchemeBaseColors
Retrieves the extra color.- Returns:
- Extra color.
-
getLightColor
Description copied from interface:SchemeBaseColors
Retrieves the light color.- Returns:
- Light color.
-
getMidColor
Description copied from interface:SchemeBaseColors
Retrieves the medium color.- Returns:
- Medium color.
-
getDarkColor
Description copied from interface:SchemeBaseColors
Retrieves the dark color.- Returns:
- Dark color.
-
getUltraDarkColor
Description copied from interface:SchemeBaseColors
Retrieves the ultra-dark color.- Returns:
- Ultra-dark color.
-
getOrigScheme
Returns the original color scheme.- Returns:
- The original color scheme.
-