Package eu.bandm.music.entities
Class Color_rgb_8
- All Implemented Interfaces:
Translet.Parseable<Color_rgb_8>
A very simple color type, sufficient for merely informational text markup, etc.
Not suited for high-definition artistic color useage.
Color values are given by the red/green/blue color model with maximal 8 bit per color.
There is a MuLi Catalog for NAMED colors, but all colors can be
adressed by numeric values. The objects representing values behave
algebraic/immutable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Translet.Parser<Integer> Aux parser which accepts two hexadecimal digits, in upper or lower case.protected short0..255, one byte value for the blue component.protected short0..255, one byte value for the green component.protected short0..255, one byte value for the red component.static final Color_rgb_8static final Color_rgb_8HTML color definition.static final Color_rgb_8static final EntityCatalog<Color_rgb_8> The catalog of all used colors.static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8New standard color name, introduces in css 2.1.static Translet.Parser<Color_rgb_8> Parser for an rgb value by three percent values, separated by comma.static Translet.Parser<Color_rgb_8> Parser for six adjacent hex digits defining one color by r-g-b.static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8static final Color_rgb_8Fields inherited from class eu.bandm.tscore.base.Entity
documentations -
Method Summary
Modifier and TypeMethodDescriptionReturns a String which prints the values of r/g/b as two hexadecimal digits each.protected static StringcanonicalCodeString(int r, int g, int b) Returns a String which prints the values of r/g/b as two hexadecimal digits each.static Color_rgb_8Find the color value, iff not present, create it, and assign it to the given MuLi names.static Color_rgb_8Find the color value, iff not present, create it, and assign it to the given MuLi names.booleanstatic Color_rgb_8find(int r, int g, int b) Find the color value, iff not present, create it.intget_b()Evidentintget_g()Evidentintget_r()EvidentinthashCode()static voidTest the different parser options.static Translet.Parser<Color_rgb_8> Get a parser only for the SYMBOLIC names, in thecatalog's default language.static Translet.Parser<Color_rgb_8> parseHumanNames(String lang) Get a parser only for the SYMBOLIC names, in the given language.static Translet.Parser<Color_rgb_8> parser()Returns a parser which accepts symbolic names in thecatalogdefault language, or three two-digit-hex values for r/g/b, or three comma separated integer values (0..100, interpreted as percentage) for r/g/b.static Translet.Parser<Color_rgb_8> Returns a parser which accepts SYMBOLIC names in the given language, or three two-digit-hex values for r/g/b, or three comma separated integer values (0..100, interpreted as percentage) for r/g/b.toString()Returns the catalog name in the default language of the correspondingcatalog, plus the r/g/b values as hexadecimal digits.Returns the explicit name of the color, in the given language only, followed by the r/g/b values as hexadecimal digits, appended in parentheses.Methods inherited from class eu.bandm.tscore.base.Entity
addName, dump, dump, getCatalog, getDocumentation, getDocumentation, getDocumentations, getName, getNames, getParser, getParser, getSpecific, setDocumentation, toString
-
Field Details
-
_red
protected short _red0..255, one byte value for the red component. -
_green
protected short _green0..255, one byte value for the green component. -
_blue
protected short _blue0..255, one byte value for the blue component. -
catalog
The catalog of all used colors. Contains as well colors which have only their canonical name (for retrieval), and those which have explicit names in different languages. -
_2HexDigits
Aux parser which accepts two hexadecimal digits, in upper or lower case. -
parse_3_hexNumbers
Parser for six adjacent hex digits defining one color by r-g-b. -
parse_3_decNumbers
Parser for an rgb value by three percent values, separated by comma. -
black
HTML color definition. There are 16 predefined values. In this class, they English/"en" names are copied from http://de.selfhtml.org/diverses/anzeige/farbnamen_8.htm. (The German language/"de" variants are of own invention.)Many more ore definitions can be found in svg, see http://www.w3.org/TR/SVG11/types.html#ColorKeywords
-
gray
- See Also:
-
maroon
- See Also:
-
red
- See Also:
-
green
- See Also:
-
lime
- See Also:
-
olive
- See Also:
-
yellow
- See Also:
-
blue
- See Also:
-
purple
- See Also:
-
fuchsia
- See Also:
-
teal
- See Also:
-
aqua
- See Also:
-
silver
- See Also:
-
white
- See Also:
-
orange
New standard color name, introduces in css 2.1. (According to selfhtml)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
canonicalCode
Returns a String which prints the values of r/g/b as two hexadecimal digits each. -
get_r
public int get_r()Evident -
get_g
public int get_g()Evident -
get_b
public int get_b()Evident -
canonicalCodeString
Returns a String which prints the values of r/g/b as two hexadecimal digits each. -
find
Find the color value, iff not present, create it. The value is looked up in thecatalog, by thecanonicalCodeString(int,int,int)of the components. -
define
Find the color value, iff not present, create it, and assign it to the given MuLi names. -
define
Find the color value, iff not present, create it, and assign it to the given MuLi names. -
toString
Returns the explicit name of the color, in the given language only, followed by the r/g/b values as hexadecimal digits, appended in parentheses. -
toString
Returns the catalog name in the default language of the correspondingcatalog, plus the r/g/b values as hexadecimal digits.- Overrides:
toStringin classEntity<Color_rgb_8>
-
parseHumanNames
Get a parser only for the SYMBOLIC names, in the given language. -
parseHumanNames
Get a parser only for the SYMBOLIC names, in thecatalog's default language. -
parser
Returns a parser which accepts SYMBOLIC names in the given language, or three two-digit-hex values for r/g/b, or three comma separated integer values (0..100, interpreted as percentage) for r/g/b. -
parser
Returns a parser which accepts symbolic names in thecatalogdefault language, or three two-digit-hex values for r/g/b, or three comma separated integer values (0..100, interpreted as percentage) for r/g/b. -
main
Test the different parser options.
-