| Copyright | (C) 2025-2026 QBayLogic B.V. |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | QBayLogic B.V. <devops@qbaylogic.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Clash.Shockwaves.Style
Description
Everything needed to add different styles to the waveform viewer.
Waveforms can be styled in a number of ways. Various standard styles are provided
in WaveStyle. It is also possible to use custom colors using WSColor.
These values can be provided in 3 typical ways:
- Directly from an
RGB Word8value, using theWSColorconstructor:WSColor (RGB 128 128 0). - From a
Colour Doublevalue, using the functionwsColor. Many such values are provided in Clash.Shockwaves.Style.Colors. - Using a string literal: if
OverloadedStringsis enabled, theWaveStylevalue can be represented using a color name or hex color string literal. SeereadColourName.
Finally, there are a few special styles.
WSErroris propagated throughout the signal hierarchy.WSDefaultis the only style to be replaced by theTStyledtranslator, and gets turned intoWSNormal.- 'WSInherit n' inherits the style of the _n_'th subsignal.
WSVarmakes it possible to define style variables in config files - this can also be created by using a string literal starting with$, which usesWSDefaultas the fallback value.WSHiddenmakes the signal appear as if it has not been assigned a value at all. This still allows the hidden text to be used in the construction of the value of a supersignal.
Some examples:
import Shockwaves.Style
import Shockwaves.Style.Colors as C
data Col = Red | Green | Blue | Yellow | Cyan | Magenta deriving ...
instance Waveform Col where
constructorStyles = [ WSColor (RGB 255 0 0) -- RGB value
, wsColor C.lime -- Colour value
, "blue" -- color name
, "#ffff00" -- hexadecimal color
, "$cyan" -- style variable "cyan"; defaults to WSDefault
, WSVar "magenta" -- style variable "magenta", defaults to #ff00ff
]
and in a translation:
Translation (Just ("(p,q)",Inherit 1,11)) -- appears as blue
[ ("a",Translation (Just ("p",WSHidden,11)) []) -- no value is shown
, ("b",Translation (Just ("q","blue" ,11)) []) ] -- appears as blue
Translation (Just ("(p,q)","blue",11)) -- appears as WSError
[ ("a",Translation (Just ("p",WSDefault,11)) []) -- appears as WSNormal
, ("b",Translation (Just ("q",WSError ,11)) []) ] -- appears as WSError
Synopsis
Documentation
The style in which a signal should be displayed.
Constructors
| WSDefault | The default waveform style. It is rendered as |
| WSError | An error value. Errors are propagated by translators. |
| WSHidden | Do not display any value, even if it exists. |
| WSInherit Natural | Copy the style of the nth subsignal. |
| WSNormal | A normal value. |
| WSWarn | A warning value. |
| WSUndef | An undefined value. |
| WSHighImp | A high impedance value. |
| WSDontCare | A value that does not matter. |
| WSWeak | A weakly defined value. |
| WSColor Color | A custom color. See Clash.Shockwaves.Style for more information. |
| WSVar String WaveStyle | A variable in a style configuration file, with a default. |
Instances
An RGB triple for an unspecified colour space.
Constructors
| RGB | |
Fields
| |
wsColor :: Colour Double -> WaveStyle Source #
Create a colored WaveStyle from a color value defined in Doubles.
This is the type of the predefined default colors in Data.Colour.
8-bit unsigned integer type
Instances
| Structured Word8 | |
Defined in Distribution.Utils.Structured | |
| ToJSON Word8 | |
| ToJSONKey Word8 | |
Defined in Data.Aeson.Types.ToJSON | |
| PrintfArg Word8 | Since: base-2.1 |
Defined in Text.Printf | |
| Binary Word8 | |
| AutoReg Word8 | |
Defined in Clash.Class.AutoReg.Internal | |
| BitPack Word8 | |
| Counter Word8 | Since: clash-prelude-1.8.2 |
| Parity Word8 | |
| NFDataX Word8 | |
Defined in Clash.XException Methods deepErrorX :: String -> Word8 # hasUndefined :: Word8 -> Bool # ensureSpine :: Word8 -> Word8 # | |
| ShowX Word8 | |
| Waveform Word8 Source # | |
Defined in Clash.Shockwaves.Internal.Waveform | |
| Default Word8 | |
Defined in Data.Default.Internal | |
| NFData Word8 | |
Defined in Control.DeepSeq | |
| Bits Word8 | Since: base-2.1 |
Defined in GHC.Internal.Word Methods (.&.) :: Word8 -> Word8 -> Word8 # (.|.) :: Word8 -> Word8 -> Word8 # xor :: Word8 -> Word8 -> Word8 # complement :: Word8 -> Word8 # shift :: Word8 -> Int -> Word8 # rotate :: Word8 -> Int -> Word8 # setBit :: Word8 -> Int -> Word8 # clearBit :: Word8 -> Int -> Word8 # complementBit :: Word8 -> Int -> Word8 # testBit :: Word8 -> Int -> Bool # bitSizeMaybe :: Word8 -> Maybe Int # shiftL :: Word8 -> Int -> Word8 # unsafeShiftL :: Word8 -> Int -> Word8 # shiftR :: Word8 -> Int -> Word8 # unsafeShiftR :: Word8 -> Int -> Word8 # rotateL :: Word8 -> Int -> Word8 # | |
| FiniteBits Word8 | Since: base-4.6.0.0 |
Defined in GHC.Internal.Word Methods finiteBitSize :: Word8 -> Int # countLeadingZeros :: Word8 -> Int # countTrailingZeros :: Word8 -> Int # | |
| Bounded Word8 | Since: base-2.1 |
| Enum Word8 | Since: base-2.1 |
Defined in GHC.Internal.Word | |
| Ix Word8 | Since: base-2.1 |
| Num Word8 | Since: base-2.1 |
| Integral Word8 | Since: base-2.1 |
| Real Word8 | Since: base-2.1 |
Defined in GHC.Internal.Word Methods toRational :: Word8 -> Rational # | |
| Show Word8 | Since: base-2.1 |
| Eq Word8 | Since: base-2.1 |
| Ord Word8 | Since: base-2.1 |
| Hashable Word8 | |
Defined in Data.Hashable.Class | |
| Uniform Word8 | |
Defined in System.Random.Internal Methods uniformM :: StatefulGen g m => g -> m Word8 # | |
| UniformRange Word8 | |
| ByteSource Word8 | |
Defined in Data.UUID.Types.Internal.Builder | |
| Unbox Word8 | |
Defined in Data.Vector.Unboxed.Base | |
| Lift Word8 | |
| Vector Vector Word8 | |
Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word8 -> ST s (Vector Word8) # basicUnsafeThaw :: Vector Word8 -> ST s (Mutable Vector s Word8) # basicLength :: Vector Word8 -> Int # basicUnsafeSlice :: Int -> Int -> Vector Word8 -> Vector Word8 # basicUnsafeIndexM :: Vector Word8 -> Int -> Box Word8 # basicUnsafeCopy :: Mutable Vector s Word8 -> Vector Word8 -> ST s () # | |
| MVector MVector Word8 | |
Defined in Data.Vector.Unboxed.Base Methods basicLength :: MVector s Word8 -> Int # basicUnsafeSlice :: Int -> Int -> MVector s Word8 -> MVector s Word8 # basicOverlaps :: MVector s Word8 -> MVector s Word8 -> Bool # basicUnsafeNew :: Int -> ST s (MVector s Word8) # basicInitialize :: MVector s Word8 -> ST s () # basicUnsafeReplicate :: Int -> Word8 -> ST s (MVector s Word8) # basicUnsafeRead :: MVector s Word8 -> Int -> ST s Word8 # basicUnsafeWrite :: MVector s Word8 -> Int -> Word8 -> ST s () # basicClear :: MVector s Word8 -> ST s () # basicSet :: MVector s Word8 -> Word8 -> ST s () # basicUnsafeCopy :: MVector s Word8 -> MVector s Word8 -> ST s () # basicUnsafeMove :: MVector s Word8 -> MVector s Word8 -> ST s () # basicUnsafeGrow :: MVector s Word8 -> Int -> ST s (MVector s Word8) # | |
| NumConvertCanonical Word8 (Unsigned 8) | |
Defined in Clash.Class.NumConvert.Internal.NumConvert Methods numConvertCanonical :: Word8 -> Unsigned 8 # | |
| NumConvertCanonical (Unsigned 8) Word8 | |
Defined in Clash.Class.NumConvert.Internal.NumConvert Methods numConvertCanonical :: Unsigned 8 -> Word8 # | |
| type BitSize Word8 | |
Defined in Clash.Class.BitPack.Internal | |
| type Canonical Word8 | |
Defined in Clash.Class.NumConvert.Internal.Canonical | |
| newtype Vector Word8 | |
| type ByteSink Word8 g | |
Defined in Data.UUID.Types.Internal.Builder type ByteSink Word8 g = Takes1Byte g | |
| newtype MVector s Word8 | |