Class Color_rgb_8

java.lang.Object
eu.bandm.tscore.base.Entity<Color_rgb_8>
eu.bandm.music.entities.Color_rgb_8
All Implemented Interfaces:
Translet.Parseable<Color_rgb_8>

public class Color_rgb_8 extends Entity<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 Details

  • Method Details

    • equals

      public boolean equals(Object o2)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • canonicalCode

      public String 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

      protected static String canonicalCodeString(int r, int g, int b)
      Returns a String which prints the values of r/g/b as two hexadecimal digits each.
    • find

      public static Color_rgb_8 find(int r, int g, int b)
      Find the color value, iff not present, create it. The value is looked up in the catalog, by the canonicalCodeString(int,int,int) of the components.
    • define

      public static Color_rgb_8 define(int r, int g, int b, Map<String,String> names)
      Find the color value, iff not present, create it, and assign it to the given MuLi names.
    • define

      public static Color_rgb_8 define(int r, int g, int b, MuLi names)
      Find the color value, iff not present, create it, and assign it to the given MuLi names.
    • toString

      public String toString(String lang)
      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

      public String toString()
      Returns the catalog name in the default language of the corresponding catalog, plus the r/g/b values as hexadecimal digits.
      Overrides:
      toString in class Entity<Color_rgb_8>
    • parseHumanNames

      public static Translet.Parser<Color_rgb_8> parseHumanNames(String lang)
      Get a parser only for the SYMBOLIC names, in the given language.
    • parseHumanNames

      public static Translet.Parser<Color_rgb_8> parseHumanNames()
      Get a parser only for the SYMBOLIC names, in the catalog's default language.
    • parser

      public static Translet.Parser<Color_rgb_8> parser(String lang)
      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

      public static Translet.Parser<Color_rgb_8> parser()
      Returns a parser which accepts symbolic names in the catalog default 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

      public static void main(String[] args)
      Test the different parser options.