static void rgb_to_hsv ( double r , double g , double b ) {
  r = r / 255.0 ;
  g = g / 255.0 ;
  b = b / 255.0 ;
  double cmax = Math . max ( r , Math . max ( g , b ) ) ;
  double cmin = Math . min ( r , Math . min ( g , b ) ) ;
  double diff = cmax - cmin ;
  double h = - 1 , s = - 1 ;
  if ( cmax == cmin ) h = 0 ;
  else if ( cmax == r ) h = ( 60 * ( ( g - b ) / diff ) + 360 ) % 360 ;
  else if ( cmax == g ) h = ( 60 * ( ( b - r ) / diff ) + 120 ) % 360 ;
  else if ( cmax == b ) h = ( 60 * ( ( r - g ) / diff ) + 240 ) % 360 ;
  if ( cmax == 0 ) s = 0 ;
  else s = ( diff / cmax ) * 100 ;
  double v = cmax * 100 ;
  System . out . println ( "(" + h + " " + s + " " + v + ")" ) ;
}

static void rgb_to_hsv ( double r , double g , double b ) { r = r / 255.0 ; g = g / 255.0 ; b = b / 255.0 ; double cmax = Math . max ( r , Math . max ( g , b ) ) ; double cmin = Math . min ( r , Math . min ( g , b ) ) ; double diff = cmax - cmin ; double h = - 1 , s = - 1 ; if ( cmax == cmin ) h = 0 ; else if ( cmax == r ) h = ( 60 * ( ( g - b ) / diff ) + 360 ) % 360 ; else if ( cmax == g ) h = ( 60 * ( ( b - r ) / diff ) + 120 ) % 360 ; else if ( cmax == b ) h = ( 60 * ( ( r - g ) / diff ) + 240 ) % 360 ; if ( cmax == 0 ) s = 0 ; else s = ( diff / cmax ) * 100 ; double v = cmax * 100 ; System . out . println ( " ( " + h + " ▁ " + s + " ▁ " + v + " ) " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_floating_point_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_floating_point_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_floating_point_literal)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) alternative: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)))))))