<commit_before>// Copyright 2002-2014, University of Colorado Boulder

define( function( require ) {
  'use strict';

  // modules
  var Color = require( 'SCENERY/util/Color' );
  var inherit = require( 'PHET_CORE/inherit' );
  var LinearGradient = require( 'SCENERY/util/LinearGradient' );
  var Rectangle = require( 'SCENERY/nodes/Rectangle' );
  var RectangularPushButton = require( 'SUN/buttons/RectangularPushButton' );

  // constants
  var DEFAULT_WIDTH = 20;
  var DEFAULT_HEIGHT = 40;

  /**
   * @param {Object} options See parent type for info about options not shown in this file
   * @constructor
   */
  function SliderKnob( options ) {

    options = _.extend( {
      width: DEFAULT_WIDTH,
      height: DEFAULT_HEIGHT,
      baseColor: '#00bfff',
      centerIndentWidth: 0, // use 0 for no line
      centerIndentColor: '#808080',
      buttonAppearanceStrategy: SliderKnob.threeDNoSquishAppearanceStrategy
    }, options );

    // Set up the margins to create the targeted height and width
    options.xMargin = ( options.width - options.centerIndentWidth ) / 2;
    options.yMargin = 5;

    // Create the center line
    if ( options.centerIndentWidth > 0 ) {
      var indentWidth = options.centerIndentWidth;
      var indentHeight = options.height - options.yMargin * 2;
      var indentFill = new LinearGradient( 0, 0, indentWidth, 0 )
        .addColorStop( 0, Color.toColor( options.centerIndentColor ).colorUtilsDarker( 0.8 ) )
        .addColorStop( 0.75, Color.toColor( options.centerIndentColor ).colorUtilsBrighter( 0.8 ) );
      options.content = new Rectangle( 0, 0, indentWidth, indentHeight, 0, 0, { fill: indentFill } );
    }
    else {
      options.minWidth = options.width;
      options.minHeight = options.height;
    }

    RectangularPushButton.call( this, options );
  }

  //TODO: If this is kept after demo and review with the PhET team, it should be consolidated with the strategy in
  //TODO: RectangularButtonView from whence it was copied.  This was copied for a fast prototype.
  var VERTICAL_HIGHLIGHT_GRADIENT_LENGTH = 7; // In screen coords, which are roughly pixels.
  var HORIZONTAL_HIGHLIGHT_GRADIENT_LENGTH = 7; // In screen coords, which are roughly pixels.
  var SHADE_GRADIENT_LENGTH = 3; // In screen coords, which are roughly pixels.<commit_msg>Set line width default back to 2 (got inadvertently set to 0).<commit_after>// Copyright 2002-2014, University of Colorado Boulder

define( function( require ) {
  'use strict';

  // modules
  var Color = require( 'SCENERY/util/Color' );
  var inherit = require( 'PHET_CORE/inherit' );
  var LinearGradient = require( 'SCENERY/util/LinearGradient' );
  var Rectangle = require( 'SCENERY/nodes/Rectangle' );
  var RectangularPushButton = require( 'SUN/buttons/RectangularPushButton' );

  // constants
  var DEFAULT_WIDTH = 20;
  var DEFAULT_HEIGHT = 40;

  /**
   * @param {Object} options See parent type for info about options not shown in this file
   * @constructor
   */
  function SliderKnob( options ) {

    options = _.extend( {
      width: DEFAULT_WIDTH,
      height: DEFAULT_HEIGHT,
      baseColor: '#00bfff',
      centerIndentWidth: 2, // use 0 for no line
      centerIndentColor: '#808080',
      buttonAppearanceStrategy: SliderKnob.threeDNoSquishAppearanceStrategy
    }, options );

    // Set up the margins to create the targeted height and width
    options.xMargin = ( options.width - options.centerIndentWidth ) / 2;
    options.yMargin = 5;

    // Create the center line
    if ( options.centerIndentWidth > 0 ) {
      var indentWidth = options.centerIndentWidth;
      var indentHeight = options.height - options.yMargin * 2;
      var indentFill = new LinearGradient( 0, 0, indentWidth, 0 )
        .addColorStop( 0, Color.toColor( options.centerIndentColor ).colorUtilsDarker( 0.8 ) )
        .addColorStop( 0.75, Color.toColor( options.centerIndentColor ).colorUtilsBrighter( 0.8 ) );
      options.content = new Rectangle( 0, 0, indentWidth, indentHeight, 0, 0, { fill: indentFill } );
    }
    else {
      options.minWidth = options.width;
      options.minHeight = options.height;
    }

    RectangularPushButton.call( this, options );
  }

  //TODO: If this is kept after demo and review with the PhET team, it should be consolidated with the strategy in
  //TODO: RectangularButtonView from whence it was copied.  This was copied for a fast prototype.
  var VERTICAL_HIGHLIGHT_GRADIENT_LENGTH = 7; // In screen coords, which are roughly pixels.
  var HORIZONTAL_HIGHLIGHT_GRADIENT_LENGTH = 7; // In screen coords, which are roughly pixels.
  var SHADE_GRADIENT_LENGTH = 3; // In screen coords, which are roughly pixels.
{'fraction_non_alphanumeric': 0.0960838861545046, 'fraction_numerical': 0.019259576289321637, 'mean_word_length': 3.3078341013824883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5603420', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1386, 'n_words': 440}