Package toxi.color

Class ColorTheme

java.lang.Object
toxi.color.ColorTheme

public class ColorTheme extends Object
A ColorTheme is a weighted collection of ColorRanges used to define custom palettes with a certain balance between individual colors/shades. New theme parts can be added via textual descriptors referring to one of the preset ColorRanges and/or NamedColors: e.g. "warm springgreen". For each theme part a weight has to be specified. The magnitude of the weight value is irrelevant and is only important in relation to the weights of other theme parts. For example: Theme part A with a weight of 0.5 will only have 1/20 of the weight of theme part B with a weight of 5.0...
  • Constructor Details

    • ColorTheme

      public ColorTheme(String name)
  • Method Details

    • addRange

      public ColorTheme addRange(ColorRange range, ReadonlyTColor col, float weight)
    • addRange

      public ColorTheme addRange(String descriptor, float weight)
    • getColor

      public TColor getColor()
    • getColors

      public ColorList getColors(int num)
      Creates a ColorList of TColors based on the theme's ranges and balance defined by their weights
      Parameters:
      num - number of colors to create
      Returns:
      new list
    • getName

      public String getName()
      Returns:
      the theme's name