MCPcopy Create free account

hub / github.com/lucasb-eyer/go-colorful / functions

Functions289 in github.com/lucasb-eyer/go-colorful

↓ 67 callersFunctionalmosteq
(v1, v2 float64)
colors_test.go:24
↓ 52 callersMethodHex
Hex /// Hex returns the hex "html" representation of the color, as in #ff0080.
colors.go:361
↓ 49 callersFunctionsq
(v float64)
colors.go:84
↓ 32 callersMethodFloat64
()
rand.go:6
↓ 23 callersMethodAlmostEqualRgb
Check for equality between colors within the tolerance Delta (1/255).
colors.go:132
↓ 20 callersFunctionHex
Hex parses a "html" hex color-string, either in the 3 "#f0c" or 6 "#ff1034" digits form.
colors.go:367
↓ 18 callersFunctionLab
Generates a color by using data given in CIE L*a*b* space using D65 as reference white. WARNING: many combinations of `l`, `a`, and `b` values do not
colors.go:658
↓ 18 callersFunctioncompareTuple
Two more zeros than the original delta, because values are divided by 100
hsluv_test.go:43
↓ 18 callersFunctionpack
(a, b, c float64)
hsluv_test.go:27
↓ 15 callersMethodXyz
XYZ /// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/
colors.go:527
↓ 13 callersMethodIsValid
Checks whether the color exists in RGB space, i.e. all values are in [0..1]
colors.go:67
↓ 12 callersFunctionXyz
(x, y, z float64)
colors.go:531
↓ 11 callersFunctionMustParseHex
This is a very nice thing Golang forces you to do! It is necessary so that we can write out the literal of the colortable below.
doc/gradientgen/gradientgen.go:40
↓ 11 callersFunctionunpack
(tuple [3]float64)
hsluv_test.go:31
↓ 10 callersMethodClamped
Returns Clamps the color into valid range, clamping each value to [0..1] If the color is valid already, this is a no-op.
colors.go:80
↓ 10 callersMethodLab
Converts the given color to CIE L*a*b* space using D65 as reference white.
colors.go:644
↓ 10 callersFunctiongetDefaultGlobalRand
()
rand.go:20
↓ 8 callersFunctionLinearRgb
LinearRgb creates an sRGB color out of the given linear RGB color (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/).
colors.go:458
↓ 7 callersMethodLinearRgb
LinearRgb converts the color into the linear RGB space (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/).
colors.go:423
↓ 6 callersFunctionHsv
Hsv creates a new Color given a Hue in [0..359], a Saturation and a Value in [0..1]
colors.go:191
↓ 6 callersMethodRGB255
Might come in handy sometimes to reduce boilerplate code.
colors.go:45
↓ 6 callersFunctionclamp01
clamp01 clamps from 0 to 1.
colors.go:74
↓ 6 callersFunctiondelinearize
(v float64)
colors.go:450
↓ 6 callersFunctioninterp_angle
Utility used by Hxx color-spaces for interpolating between two angles in [0,360].
colors.go:148
↓ 6 callersFunctionlinearize
Linear /// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/ http://www.brucelindbloom.com/Eqn_RGB_to_XYZ.html
colors.go:415
↓ 5 callersMethodA98Rgb
()
widegamut.go:137
↓ 5 callersMethodDisplayP3
()
widegamut.go:68
↓ 5 callersMethodDistanceCIEDE2000
DistanceCIEDE2000 uses the Delta E 2000 formula to calculate color distance. It is more expensive but more accurate than both DistanceLab and Distance
colors.go:722
↓ 5 callersMethodIntn
(n int)
rand.go:7
↓ 5 callersMethodLuv
Converts the given color to CIE L*u*v* space using D65 as reference white. L* is in [0..1] and both u* and v* are in about [-1..1]
colors.go:877
↓ 5 callersFunctionLuvToXyzWhiteRef
(l, u, v float64, wref [3]float64)
colors.go:856
↓ 5 callersFunctionMakeColor
Constructs a colorful.Color from something implementing color.Color
colors.go:26
↓ 5 callersMethodProPhotoRgb
()
widegamut.go:202
↓ 5 callersMethodRec2020
()
widegamut.go:272
↓ 5 callersFunctionalmosteq_eps
Dummy for benchmarks to avoid optimization Checks whether the relative error is below eps
colors_test.go:14
↓ 4 callersMethodBlendHcl
BlendHcl blends two colors in the CIE-L*C*h° color-space, which should result in a smoother blend. t == 0 results in c1, t == 1 results in c2
colors.go:982
↓ 4 callersMethodHPLuv
HPLuv returns the Hue, Saturation and Luminance of the color in the HSLuv color space. Hue in [0..360], a Saturation [0..1], and a Luminance (lightnes
hsluv.go:115
↓ 4 callersMethodHSLuv
HSLuv returns the Hue, Saturation and Luminance of the color in the HSLuv color space. Hue in [0..360], a Saturation [0..1], and a Luminance (lightnes
hsluv.go:104
↓ 4 callersFunctionHcl
Generates a color by using data given in HCL space using D65 as reference white. H values are in [0..360], C and L values are in [0..1] WARNING: many
colors.go:960
↓ 4 callersMethodLuvLCh
LuvLch Converts the given color to LuvLCh space using D65 as reference white. h values are in [0..360], C and L values are in [0..1] although C can ov
colors.go:1001
↓ 4 callersFunctionLuvLChToLuv
(l, c, h float64)
colors.go:1032
↓ 4 callersMethodLuvLChWhiteRef
Converts the given color to LuvLCh space, taking into account a given reference white. (i.e. the monitor's white) h values are in [0..360], c and l va
colors.go:1020
↓ 4 callersFunctionSoftPaletteExWithRand
Yeah, windows-stype Foo, FooEx, screw you golang... Uses K-means to cluster the color-space and return the means of the clusters as a new palette of d
soft_palettegen.go:34
↓ 4 callersMethodXyzD50
()
widegamut.go:33
↓ 4 callersFunctionXyzToLinearRgb
XyzToLinearRgb converts from CIE XYZ-space to Linear RGB space.
colors.go:496
↓ 4 callersFunctionXyzToOkLab
(x, y, z float64)
colors.go:1069
↓ 4 callersFunctiondelinearizeA98
(v float64)
widegamut.go:101
↓ 4 callersFunctiondelinearizeProPhoto
(v float64)
widegamut.go:168
↓ 4 callersFunctiondelinearizeRec2020
(v float64)
widegamut.go:238
↓ 4 callersMethodfind
find returns an arbitrary element of a set when invoked on any element of the set, The important feature is that it returns the same value when invoke
sort.go:28
↓ 4 callersFunctionlinearizeA98
A98 RGB /// Adobe RGB (1998) color space.
widegamut.go:92
↓ 4 callersFunctionlinearizeProPhoto
ProPhoto RGB /// ProPhoto RGB (ROMM RGB) uses D50 illuminant.
widegamut.go:161
↓ 4 callersFunctionlinearizeRec2020
(v float64)
widegamut.go:231
↓ 4 callersMethodvalues
Used to simplify HSLuv testing.
colors.go:53
↓ 3 callersFunctionA98Rgb
(r, g, b float64)
widegamut.go:131
↓ 3 callersMethodBlendHsv
You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl.
colors.go:224
↓ 3 callersMethodBlendLab
BlendLab blends two colors in the L*a*b* color-space, which should result in a smoother blend. t == 0 results in c1, t == 1 results in c2
colors.go:805
↓ 3 callersMethodBlendLuv
BlendLuv blends two colors in the CIE-L*u*v* color-space, which should result in a smoother blend. t == 0 results in c1, t == 1 results in c2
colors.go:915
↓ 3 callersMethodBlendRgb
You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl.
colors.go:139
↓ 3 callersFunctionDisplayP3
(r, g, b float64)
widegamut.go:62
↓ 3 callersMethodDistanceCIE76
DistanceCIE76 is the same as DistanceLab.
colors.go:678
↓ 3 callersMethodDistanceCIE94
Uses the CIE94 formula to calculate color distance. More accurate than DistanceLab, but also more work.
colors.go:684
↓ 3 callersMethodDistanceLab
DistanceLab is a good measure of visual similarity between two colors! A result of 0 would mean identical colors, while a result of 1 or higher means
colors.go:671
↓ 3 callersMethodError
()
hexcolor.go:41
↓ 3 callersMethodHcl
HCL /// HCL is nothing else than L*a*b* in cylindrical coordinates! (this was wrong on English wikipedia, I fixed it, let's hope the fix stays.) But
colors.go:932
↓ 3 callersMethodHsv
HSV /// From http://en.wikipedia.org/wiki/HSL_and_HSV Note that h is in [0..359] and s,v in [0..1] Hsv returns the Hue [0..359], Saturation and Value
colors.go:161
↓ 3 callersFunctionLabToHcl
(L, a, b float64)
colors.go:936
↓ 3 callersMethodOkLab
OkLab ///
colors.go:1061
↓ 3 callersFunctionOkLabToOkLch
(l, a, b float64)
colors.go:1125
↓ 3 callersFunctionOkLabToXyz
(l, a, b float64)
colors.go:1079
↓ 3 callersFunctionProPhotoRgb
(r, g, b float64)
widegamut.go:196
↓ 3 callersFunctionRec2020
(r, g, b float64)
widegamut.go:266
↓ 3 callersFunctionXyzToLuvWhiteRef
(x, y, z float64, wref [3]float64)
colors.go:825
↓ 3 callersFunctiondelinearize_fast
(v float64)
colors.go:462
↓ 3 callersFunctionlab_f
L*a*b* /// http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions For L*a*b*, we need to L*a*b*<->XYZ->RGB and the first one is devic
colors.go:601
↓ 3 callersFunctionlab_finv
(t float64)
colors.go:623
↓ 3 callersFunctionlinearize_fast
A much faster and still quite precise linearization using a 6th-order Taylor approximation. See the accompanying Jupyter notebook for derivation of th
colors.go:432
↓ 3 callersFunctionxyz_to_uv
For this part, we do as R's graphics.hcl does, not as wikipedia does. Or is it the same?
colors.go:840
↓ 2 callersMethodBlendA98Rgb
BlendA98Rgb blends two colors in the A98 RGB color-space. t == 0 results in c1, t == 1 results in c2
widegamut.go:148
↓ 2 callersMethodBlendDisplayP3
BlendDisplayP3 blends two colors in the Display P3 color-space. t == 0 results in c1, t == 1 results in c2
widegamut.go:79
↓ 2 callersMethodBlendLinearRgb
BlendLinearRgb blends two colors in the Linear RGB color-space. Unlike BlendRgb, this will not produce dark color around the center. t == 0 results in
colors.go:513
↓ 2 callersMethodBlendLuvLCh
BlendLuvLCh blends two colors in the cylindrical CIELUV color space. t == 0 results in c1, t == 1 results in c2
colors.go:1050
↓ 2 callersMethodBlendOkLab
BlendOkLab blends two colors in the OkLab color-space, which should result in a better blend (even compared to BlendLab).
colors.go:1096
↓ 2 callersMethodBlendOkLch
BlendOkLch blends two colors in the OkLch color-space, which should result in a better blend (even compared to BlendHcl).
colors.go:1143
↓ 2 callersMethodBlendProPhotoRgb
BlendProPhotoRgb blends two colors in the ProPhoto RGB color-space. t == 0 results in c1, t == 1 results in c2
widegamut.go:213
↓ 2 callersMethodBlendRec2020
BlendRec2020 blends two colors in the Rec. 2020 color-space. t == 0 results in c1, t == 1 results in c2
widegamut.go:283
↓ 2 callersFunctionD50ToD65
Wide-gamut RGB color spaces from CSS Color Level 4. https://www.w3.org/TR/css-color-4/#color-conversion-code Bradford /// Bradford chromatic adaptati
widegamut.go:12
↓ 2 callersFunctionD65ToD50
(x, y, z float64)
widegamut.go:19
↓ 2 callersMethodDistanceLuv
DistanceLuv is a good measure of visual similarity between two colors! A result of 0 would mean identical colors, while a result of 1 or higher means
colors.go:907
↓ 2 callersMethodDistanceRgb
DistanceRgb computes the distance between two colors in RGB space. This is not a good measure! Rather do it in Lab space.
colors.go:94
↓ 2 callersFunctionFastHappyColorWithRand
Creates a random bright, "pimpy" color through a restricted HSV space.
colorgens.go:38
↓ 2 callersFunctionFastLinearRgb
FastLinearRgb is much faster than and almost as accurate as LinearRgb. BUT it is important to NOTE that they only produce good results for valid input
colors.go:491
↓ 2 callersMethodFastLinearRgb
FastLinearRgb is much faster than and almost as accurate as LinearRgb. BUT it is important to NOTE that they only produce good results for valid color
colors.go:443
↓ 2 callersFunctionFastWarmColorWithRand
Creates a random dark, "warm" color through a restricted HSV space.
colorgens.go:6
↓ 2 callersFunctionHPLuv
HPLuv creates a new Color from values in the HPLuv color space. Hue in [0..360], a Saturation [0..1], and a Luminance (lightness) in [0..1]. The retu
hsluv.go:95
↓ 2 callersFunctionHPLuvToLuvLCh
(h, s, l float64)
hsluv.go:64
↓ 2 callersFunctionHSLuv
HSLuv creates a new Color from values in the HSLuv color space. Hue in [0..360], a Saturation [0..1], and a Luminance (lightness) in [0..1]. The retu
hsluv.go:84
↓ 2 callersFunctionHSLuvToLuvLCh
(h, s, l float64)
hsluv.go:33
↓ 2 callersFunctionHappyColorWithRand
Creates a random bright, "pimpy" color through restricted HCL space. This is slower than FastHappyColor but will likely give you colors which have the
colorgens.go:52
↓ 2 callersFunctionHclWhiteRef
Generates a color by using data given in HCL space, taking into account a given reference white. (i.e. the monitor's white) H values are in [0..360],
colors.go:975
next →1–100 of 289, ranked by callers