Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

List of colours/colors.

Can anyone direct me to a list of colour names supported by Titanium Mobile? Can't seem to find one !

TIA

— asked July 5th 2010 by Alan Bourke
  • color
  • colour
  • mobile
  • titanium
0 Comments

3 Answers

  • Accepted Answer

    The safest methods are #RGB and #RRGGBB.

    — answered July 5th 2010 by Dan Tamas
    permalink
    0 Comments
  • This list is from iPhone/Classes/Webcolor.m:

    colorLookup = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                           black,@"black",
                           [UIColor grayColor],@"gray",
                           [UIColor darkGrayColor],@"darkgray",
                           [UIColor lightGrayColor],@"lightgray",
                           white,@"white",
                           [UIColor redColor],@"red",
                           [UIColor greenColor],@"green",
                           [UIColor blueColor],@"blue",
                           [UIColor cyanColor],@"cyan",
                           [UIColor yellowColor],@"yellow",
                           [UIColor magentaColor],@"magenta",
                           [UIColor orangeColor],@"orange",
                           [UIColor purpleColor],@"purple",
                           [UIColor brownColor],@"brown",
                           [UIColor clearColor],@"transparent",
                           [UIColor groupTableViewBackgroundColor],@"stripped",
    
                           // these are also defined by the W3C HTML spec so we support them
                           [Webcolor colorForHex:@"#0ff"],@"aqua",
                           [Webcolor colorForHex:@"#f0f"],@"fuchsia",
                           [Webcolor colorForHex:@"#0f0"],@"lime",
                           [Webcolor colorForHex:@"#800"],@"maroon",
                           [Webcolor colorForHex:@"#FFC0CB"],@"pink",
                           [Webcolor colorForHex:@"#000080"],@"navy",
                           [Webcolor colorForHex:@"#c0c0c0"],@"silver",
                           [Webcolor colorForHex:@"#808000"],@"olive",
                           [Webcolor colorForHex:@"#008080"],@"teal",
    
                           white,@"fff",
                           white,@"ffff",
                           white,@"ffffff",
                           white,@"ffffffff",
                           black,@"000",
                           black,@"f000",
                           black,@"000000",
                           black,@"ff000000",
                           nil];
    
    — answered June 28th 2012 by Nils
    permalink
    0 Comments
  • Most color properties accept #RGB format I think.
    I don't know if it's global - but some also accept: #RGB, #RRGGBB, #ARGB & #AARRGGBB

    — answered July 5th 2010 by David Ashwood
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.