Sha256: c8406cb09155de65de645e147a1a6086a4d313df1c23a5c08463f56805eb1361

Contents?: true

Size: 1.33 KB

Versions: 15

Compression:

Stored size: 1.33 KB

Contents

//FUNCTIONS
@function determine-color($color){
	$high: red($color);
	$r_color: 0;
	@if (green($color) > $high){
		$high: green($color);
		$r_color: 1;
	}
	@if (blue($color) > $high){
		$high: blue($color);
		$r_color: 2;
	}
  @return $r_color;
}

@function alert($p-color){
	//determine what primary color is closest to then alter
	@if (determine-color($p-color) == 0){
		@return adjust-hue($p-color, 0);
	}
	@if (determine-color($p-color) == 1){
		@return adjust-hue($p-color, -135);
	}
	@if (determine-color($p-color) == 2){
		@return adjust-hue($p-color, 150);
	}
}

@function success($p-color){
	@if (determine-color($p-color) == 0){
		@return adjust-hue($p-color, 135);
	}
	@if (determine-color($p-color) == 1){
		@return adjust-hue($p-color, 0);
	}
	@if (determine-color($p-color) == 2){
		@return adjust-hue($p-color, -60);
	}
}

@function warning($p-color){
	@if (determine-color($p-color) == 0){
		@return adjust-hue($p-color, 30);
	}
	@if (determine-color($p-color) == 1){
		@return adjust-hue($p-color, 255);
	}
	@if (determine-color($p-color) == 2){
		@return adjust-hue($p-color, 200);
	}
}

@function info($p-color){
	@if (determine-color($p-color) == 0){
		@return adjust-hue($p-color, 200);
	}
	@if (determine-color($p-color) == 1){
		@return adjust-hue($p-color, 60);
	}
	@if (determine-color($p-color) == 2){
		@return adjust-hue($p-color, 0);
	}
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
staple-0.4.5 source/styles/staple/helpers/color_functions.scss
staple-0.4.4 source/styles/staple/helpers/color_functions.scss
staple-0.4.3 source/styles/staple/helpers/color_functions.scss
staple-0.4.2 source/styles/staple/helpers/color_functions.scss
staple-0.4.1 source/styles/staple/helpers/color_functions.scss
staple-0.3.0 source/styles/staple/helpers/color_functions.scss
staple-0.2.1 source/styles/staple/helpers/color_functions.scss
staple-0.2.0 source/styles/staple/helpers/color_functions.scss
staple-0.1.7 source/stylesheets/staple/helpers/color_functions.scss
staple-0.1.6 source/stylesheets/staple/helpers/color_functions.scss
staple-0.1.5 source/stylesheets/staple/helpers/color_functions.scss
staple-0.1.4 source/stylesheets/staple/helpers/color_functions.scss
staple-0.1.3 source/stylesheets/staple/helpers/color_functions.scss
staple-0.1.2 source/stylesheets/staple/color_functions.scss
staple-0.1.1 source/stylesheets/staple/color_functions.scss