Skip to content

Commit

Permalink
docs: improved function arguments naming (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechsimetka authored Jul 21, 2023
1 parent a18ea9e commit db24e88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,31 @@ export interface HUE {

// Utility conversion functions
function hexToRgb(hex: string): RGB
function rgbToHex({ r, g, b }: RGB): string
function hslToRgb({ h, s, l }: HSL): RGB
function rgbToHsl({ r, g, b }: RGB): HSL
function rgbToHex(rgb: RGB): string
function hslToRgb(hsl: HSL): RGB
function rgbToHsl(rgb: RGB): HSL

// Calculate luminance
function calculateLuminance(rgbOrHex: RGB | string): number
function calculateLuminance(color: RGB | string): number

// Find color with same hue that would be closest to a targetLuminance (uses bisection algorithm with at most 100 iterations)
function getClosestColor(
hex: string,
sourceColor: string,
targetLuminance: number,
targetPrecision?: number,
maxSteps?: number
): string

function getClosestColorBisection(
hex: string,
sourceColor: string,
targetLuminance: number,
targetPrecision?: number,
maxSteps?: number
): string

// Implementation with newton itterative method, better results than bisection for more than 100 iterations
function getClosestColorNewton(
hex: string,
sourceColor: string,
targetLuminance: number,
targetPrecision?: number,
maxSteps?: number
Expand Down

0 comments on commit db24e88

Please sign in to comment.