@Override public void validateColorCode(String code){
  Preconditions.checkNotEmpty(code,"color code is empty");
  Integer numericColorCode=Integer.valueOf(code);
  boolean isColorCodeValid=numericColorCode > 0 && numericColorCode < 257;
  if (!isColorCodeValid) {
    throw new IllegalArgumentException("color code should be a number between 1 and 256");
  }
}

@ Override public void validateColorCode ( String code ) { Preconditions . checkNotEmpty ( code , "color code is empty" ) ; Integer numericColorCode = Integer . valueOf ( code ) ; boolean isColorCodeValid = numericColorCode > 0 && numericColorCode < 257 ; if ( ! isColorCodeValid ) { throw new IllegalArgumentException ( "color code should be a number between 1 and 256" ) ; } }
validates terminal color code for reference check website : http : / / misc . flogisoft . com / bash / tip_colors_and_formatting
